CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 1999
    Posts
    21

    combo search with RDO

    Hi )

    Does anybody know how to search for a record with interactivity when using a ComboBox and RDO programming.

    Thanks ;-)

    Duke1000 :-)


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: combo search with RDO

    You weren't very precise, so here's my interpretation of your question:

    Create a Form with a Combobox set the Style to Simple and Make it a fair size, same as a Listbox would be. Create an ODBC DSN for the NorthWind Example MDB, then set a Reference to the MS Remote Data Object Library:

    private oCon as new rdoConnection
    private oRs as rdoResultset

    private Sub Combo1_KeyUp(KeyCode as Integer, Shift as Integer)
    Dim sTmp as string
    Dim iPos as Integer
    set oRs = oCon.OpenResultset("SELECT FirstName FROM Employees WHERE FirstName LIKE '" & Combo1 & "%' ORDER BY FirstName", rdOpenForwardOnly)
    iPos = Combo1.SelStart
    sTmp = Combo1
    Combo1.Clear
    While Not oRs.EOF
    Combo1.AddItem oRs(0)
    oRs.MoveNext
    Wend
    Combo1.SelText = sTmp
    Combo1.SelStart = iPos
    End Sub

    private Sub Form_Load()
    oCon.Connect = "DSN=NorthWind;uid=;pwd=;"
    oCon.CursorDriver = rdUseNone
    oCon.EstablishConnection
    Combo1 = ""
    End Sub

    private Sub Form_Unload(Cancel as Integer)
    set oRs = nothing
    oCon.Close
    set oCon = nothing
    End Sub





    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

  3. #3
    Join Date
    Oct 1999
    Posts
    21

    Re: combo search with RDO

    Hi Aaron )

    Thanks for answering, but like you said, I was'nt precise enough. That's my fault.

    Here's the new question. I have multiples TextBox and a ComboBox to search for record. What I'd like to know is how to change the TextBoxes content interactively with the record that I found in the ComboBox (by typing in or by selecting an item in the list).

    I'm still working with RDO.

    Thanks

    Duke1000 )


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured