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

Form Combo-box linked to a query

Status
Not open for further replies.

matpj

Technical User
Mar 28, 2001
687
GB
I have a query which returns a couple fields - Customer and Stand Number.

On my main form, I have created two combo boxes that lookup the two columns in the query.

I need to get the combo-boxes linked somehow, so that when the user selects the stand number from the combo-box, it automatically returns the relavent customer in the other combo-box. And vice-versa, customer is picked and the stand number is displayed.

I do not know much about coding or modules/functions/events, so if anyone can tell me in simple terms what to do and tpe, I would be very grateful.

thanks in advance,
Matthew
 
It looks like what you need is to requery based on the On Change events of the two ComboBoxes. Or maybe you need to rerun your query in the On Change events.

I think the requery only works if you have parent form and sub forms.

The code for rerunning your query may look something like:
Private Sub Combo1_Change()

Put SQL Query here
Me!refresh

End sub


Or try calling your original query (I'm not sure how to do this, but I think it can be done).

Sorry if this isn't specific enough but I an only a part timer in the field of databases and it has been about 9 months since I've done any code.

Hope this helps generate some ideas for you

Dave
 
are you not seeing the section that ask if you want the
field to be automatic updated?that happen when you
build your combo box
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top