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

Combo Boxes

Status
Not open for further replies.

Dickx

Technical User
Aug 24, 2001
33
US
I have created an application calling for the entry in one Combo Box (Customer) which then populates the dropdown list of a second Combo Box (Structure).The code seems to work except when I try to change my selection from the first item in the Structure field. Clicking on the down arrow to enter another item does not work. If I manually try keying in the second item in the list, on leaving the field, the it replaces my entry with the first item. The SQL query in the Row source for the Structure field is;

SELECT Structure.Customer, Structure.Structure FROM Structure WHERE (((Structure.Customer)=Forms!Quote!ComboCustomer)) ORDER BY Structure.Structure;

The code behind the Customer field and Form is;

Private Sub ComboCustomer_AfterUpdate()

Me.ComboStructure = Null
Me.ComboStructure.Requery
Me.ComboStructure = Me.ComboStructure.ItemData(0)
End Sub

Private Sub Form_Current()
Me.ComboStructure.Requery
End Sub

Would appreciate any suggestions on fixing this problem.
 
Customer being the first item in your select statement, can I assume that it is bound to the second field? If not, could that be the problem? Maybe it hides the first column, but is still bound to it, so the value of Customer gives the first structure in the list?

Thanks,
ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
Sounds like you are not using the combo boxes as they are intended...I mean they are working as you programmed them, but maybe that's not what you mean for them to do. Check this out and see if it's more what you want:

thread702-1100035

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top