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

Update Combo Box

Status
Not open for further replies.

WPCC

Programmer
May 21, 2002
4
US
Here is another simple problem that I can't seem to solve. I have a form with a drop down combo box in the form header that can be used to select a recorded based on the company name. That works fine, when you select AAA, AAA's record populates the form. But if you navigate through the records with the arrows at the bottom the combo box in the header doesn't change. When you are on BBC's listing the combo box still displays AAA. Is there a VB way of updating the selected value of the combo box when I change records?
 
I solved my own problem, or rather found a response that helped. I added a line to my form On_Current event

cbCompanyName = MemberID

Thanks to who ever posted that response. (Not sure who it was.)
 
You will need to explicitly set the value of the combo box to the correct value. It won't update automatically. Is your form bound or unbound? If it is bound, you can reference the value in the table through the RecordsetClone property. If it is unbound, you will have to create a recordset to retrieve the value out of the table. Then you would set the combo box value to the value of the field.

Best,

dz
 
We must have been typing at the same time. Your solution works because the form and control are both bound. It's nice to find any easy solution! dz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top