|
-
November 5th, 1999, 09:28 PM
#1
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 :-)
-
November 5th, 1999, 10:31 PM
#2
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]
-
November 6th, 1999, 11:54 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|