I'm having trouble using a form to collect parameters for a query

8

84

I'm trying to use a form with a combo box to collect parameters for a
parameter query in Access 2003. In the criteria box, I have entered
"[Forms]![Products]![Product Name]". However, when I call the procedure, I
get the standard parameter text box with a text box name of
"Forms!Products!Product Name". Any ideas what I'm doing wrong?
 
N

Nikos Yannacopoulos

Just lose the quotes! They are telling Access that their content is a
text string you want to match, whereas in reality you want a reference
to the combo on the form - which is what you will get by removing the
quotes.

HTH,
Nikos
 
8

84

I didn't use the quotes in the query, I simply used them in the question to
distinguish the procedure call. I appreciate your response though - do you
have any other ideas? Thank you.
 
N

Nikos Yannacopoulos

84 said:
I didn't use the quotes in the query, I simply used them in the question to
distinguish the procedure call. I appreciate your response though - do you
have any other ideas? Thank you.

I suppose the form is open when you run the query, right?

Check the spelling of the form and the combo box name, it might be just
a spelling mistake. To check, open the immediate window in the VBA
screen (Ctrl + G) and type?

?[Forms]![Products]![Product Name]

and hit enter, while the form is open and a selection made in the combo.
Do you get the combo value returned? If not, the reference is wrong.

Nikos
 

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