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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box after update in vb?

Status
Not open for further replies.

Oliver2003

Technical User
Apr 19, 2003
144
GB
I have been used to using the combo box in ms access but have recently started designing a front end to a access db in vb

In my access form I had a combo box with the row source set to "Names" in table "Contacts", in the after update event of the combo box I used Dlookup to get "Address", "Telephone" etc and display in text boxes.

My question is how would this be done in vb?

Thank You

I have looked at the change event but this does not seem to fire when a item form the combo is selected.

 
Depends. If you want it to do this as soon as an item is selected, use the Click event.
Otherwise, use the Validate event, which is like an AfterUpdate event.
 
Use the click event for the combo box. The update and change events do not fire when a bound combo box selects a different value in its bound recordset.

You can get the value by setting up a new recordset and retrieving the "Address", "Phone", etc. fields into it OR, if you also want those bound to text boxes than add a data control to your form and populate its recordset property with the fields that you want. Make that data control the DataSource for the text boxes and specify the DataField property of each text box as the name of the field that you want displayed.
 
Thanks for the replies, the click event does the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top