totally stumped

R

r

Still can't get this.

I have a main menu form (MainMenu) on which there are two controls, a
dropdown (SelectedID) and a button.

The dropdown (SelectedID) does not have a control source because it is just
a list to select from. The row source is a table (Customers) that has only
two fields, CustNo (text) and CustName (text). The control is bound by the
first column, CustNo.

The button runs a macro that opens another form (CustDetail) and uses
OpenForm with a Where criteria of
[CustomerID]=[Forms]![MainMenu]![SelectedID].

The detail form (CustDetail) is bound to a table (Budget) where there are
two fields, CustomerID (text), and BudgetAmt (currency).

When I click the button, I get a dialog box asking me to enter the value for
[Forms]![MainMenu]![SelectedID].

I just don't get it!!!! What am I doing wrong?! Is this because the
dropdown on the main menu form doesn't have a control source?!

Help!
 
K

Ken Snell [MVP]

Try this for the OpenForm:

DoCmd.OpenForm "CustDetail", , , "[CustomerID]=" & Me!SelectedID
 
S

Steve Schapel

r said:
When I click the button, I get a dialog box asking me to enter the value for
[Forms]![MainMenu]![SelectedID].

I just don't get it!!!! What am I doing wrong?! Is this because the
dropdown on the main menu form doesn't have a control source?!

No, it is not related to the combobox being unbound. The most likely
cause of this is a spelling error. Are you sure the form is named
MainMenu? Are you sure the combobox is named SelectedID? Er, you don't
have a Close action in your macro before the OpenForm action do you?
 

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

Top