We help IT Professionals succeed at work.

setting the rowsource of a combo box error

whatemail
whatemail asked
on
HI,

I can't figure this out.  Please help!!
There are two combo boxes, the first will determine what values can be selected in the second.  I have placed code in the afterUpdate() of the first cbo to set the Rowsource of the second combo box.

but i get an error
"The MS Jet Database engine could not find the input table or query '~sq_cfrm .....' Make sure it exists."

Do you know what could be wrong, if so please help!!
Comment
Watch Question

Commented:
If I understand you, you want to base one cbo on anopther one.  so if you have 2 cbo's one displaying products the other is the product category.  you select a category and only the products under that category should show up when you click the products cbo, right?

in the category cbo on the afterupdate me!cboproducts.requery

in the products cbo in the rowsource property include the fields; product id and product name, and category.
the criteria for the category should read:
forms!mainform!cbocategory.  this will limit the records in this cbo toonly the products that are related to the category displayed.

Author

Commented:
But i need to use the same subform on two different forms so this is not working for me.  I was trying to change the rowsource to allow for the different parent forms.  is that right?
What riteria are you using to link the subform to the two main forms?

Commented:
so you're saying that the cbo's on the subform that is going to be used on 2 other forms is going to be different based on the the form.  if so then test to see the form and then change the rowsource of the cbo.  you can set the properties of the cbo at run time.

Author

Commented:
Thanks and sorry for the delay.