Parameter query

  • Thread starter Thread starter k.roberts
  • Start date Start date
K

k.roberts

There are two parts to my question:

Firstly I have created a parameter query which asks for an insitution
code, then brings forward the contact details for that insitution.
This query works fine except the prompt box pops up twice before
actually displaying the information requested. Can anyone tell me why
this happens?

Secondly, I would like to have a command button on a form that will run
this query i.e. when you click the command button, the prompt for the
query comes up and then displays the requested information in a form.
How do I do this? I have attached a macro to the OnClick property of
the button which runs the query, but this displays it in datasheet
view. Help!
 
Another approach would be:

* create a form in which your user selects the institution from a combo
box (no need to memorize institution codes!)
* create a query that uses a reference to that form/combo box to get its
selection criterion (no need for a parameter prompt!)
* create a report based on the query
* modify the form by adding a command button that opens the report -- you
can get tricky by only enabling the command button after a choice is made in
the combo box.

The downside? the form MUST be open to successfully run the report (if not,
there's a parameter prompt!).
 
Your first question --
It might be because you used the parameter in two places but have it typed
slightly different. I avoid this possibility by typing once then copying and
pasting everywhere I used it again.
 
Back
Top