Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to populate a Datacombo??

Status
Not open for further replies.

Quique79

Programmer
Dec 18, 2001
15
MX
Hi all!!

I have a form where depending on a value in a textbox, the Datacombo should be populated with a specific info.

I've tried with Onlostfocus event of the textbox, trying to put Datacombo's rowsource to the specific table, but it doesn't work

Any hint or tip? Quique79
 
Why use Lost Focus ?
Try AfterUpdate because you don't want to bother setting the Combo RowSource if the data in the txtBox has not changed.

Other than that ???
Sub txtBox_AfterUpdate()
cboBoxName.RowSource = "SELECT field1, field2 FROM tblName WHERE fldSelect = '" & txtBox & "'"
End Sub

Should do

If it doesn't, then what IS it doing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top