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

Requery Combobox on subform

Status
Not open for further replies.

spencern

Programmer
Dec 20, 2001
78
US
Hello,
I have a main form add_customers that has a subform Equipment_Subform1. One of the fields in the subform is a combo box that gets its data from another table. I have a button to open a form to add entries to the table that the combo box gets its data from. After I add entries I want to close the form and have the combo box update. I have this code in the onclose event of the form:
Forms!Add_Equipment1!Combo6.Requery. Combo6 is the box on my subform. When I try this it says that Access can't find the subform-Runtime error 2450. If I open the subform by itself under my main form and try the code again, then it works fine. It's as if Access can't see the subform.

What do I need to change to make this work? I've been looking around this site and trying different code that I've seen but none of it works.

Thanks for your help,
Spencer
 
Thanks for the link Bill, very helpful...
I ended up using Forms!Mainform!Subform1.Form!ControlName and it seems to work fine.

Thanks again for your help,
Spencer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top