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

combo boxes in subforms

Status
Not open for further replies.

PabloGeek

Technical User
Feb 1, 2002
2
NZ
I have a main form for my 'jobs' and a subform where I want to input the data about what products were used on each job. I want to use one combo box to pick a certain supplier, and the next combo box to only display that supplier's products to pick from. I have a jobs table, a products tables and a suppliers table, with the key field from the suppliers table also in the products table. I have tried the 'where' clause in the underlying query for the second combo box but with no success.
Thanks for any help from anyone!
 
Dear PabloGeek
You say 'with little success'
What error messages or results (i.e. lack of) are you getting from the setup you have at the present?

It might be an idea to tell us a little more about the relationships between the underlying tables and the Record Sources of your form and subform.
It makes it a little easier to answer your Question.
Regards Jim
 
I have checked the forums and now the subform works, when it is opened on its own - ie the first combo box is used to pick the supplier ID in the products table, and the second combo box then only shows the products relevant to that supplier.
However, when I open the main jobs form, and use the subform, after updating the first combo box to the supplier ID, I get an error message as Access cannot requery the second combo box - it says it cannot find the reference to the subform in the code! So maybe it is a problem with subforms . . .
Thanks for the help.
 
Dear MrsPabGeek,
cannot find the reference to the subform in the code.

Is the subform you checked the same one that is in the mainform (sometimes it gets really confusing with sfrms!)

Have you checked the after-update event code on the first combo box.
Post it here if you still can't see why

Also What version of Access are you using?

Regards Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top