Requery Combo Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is wrong with the following code? It comes up with the error
frmsuppliermenu cannot be found....the name is definately correct as i paster
from database window. I have also tried wrapping the object names in [] but
this didnt help.

Forms!frmSupplierMenu!subfrmContractsDetails!cboOwner.Requery

Can anyone help...this has been driving me crazy for the past 2 hours now!!!

Thanks
 
Here's how to debug this.

1. Press Ctrl+G to open the Immediate window.

2. Enter:
? Forms!frmSupplierMenu.Name
If that fails, the name is incorrect, or the form is not open.

3. Once that's working, try:
? Forms!frmSupplierMenu.subformContractDetails.Name
If that fails, open the frmSupplierMenu form in design view, right-click on
the subform control and choose Properties. What is the Name of the subform
control? It can be different from the name of the form that gets loaded into
the control (i.e. its SourceObject).

4. Once that's working, try:
? Forms!frmSupplierMenu.subformContractDetails.Form!cboOwner.Name

Once you get that working, you should be able to get the Requery happening.
 
Hi,

The correct and full way to refer to a contol on a sub form is:

Forms("Your Form Name")("Subform Control Name").Form.Controls("Your Control
Name")

So try

Forms("frmSupplierMenu")("subfrmContractsDetails").Form.Controls("cboOwner").Requery


--
HTH

Mark Phillipson

Free Add-Ins at; http://mphillipson.users.btopenworld.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

problems with 'cbo's and requery 2
Requery Combo box in popup form 2
Requery Form from Combo Box 3
Combo Boxes & Requery Issues 2
Requery combo box on a subform 3
Requery combo box 1
Requery a combo box 2
Requery 2

Back
Top