Query Variable entry via a pop up window

  • Thread starter Thread starter K8Gardner
  • Start date Start date
K

K8Gardner

I would like to add a button to a form in my database that will do the
following:

Open a pop-up window that will allow users to enter variables into one or
more pre-specified fields in a query.

Then I want them to be able to export the results of that query.

I don't know much about VBA so I kind of need a simple but detailed
explanation of how to do this if possible.

Thanks.
 
"simple but detailed" seems a bit paradoxical!

Rather than using a popup form, why not use a regular form in which your
users either make their selections and/or enter criteria, then add a button
that runs the report? You'd need to have the report based on a query, and
the query based on (using) the selection criteria on the form, but this
approach is fairly common for what you've described.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thanks Jeff for your response.

The users do eventually need to have the information in a spreadsheet
although I wouldn't mind learning how to generate a report that pulls user
defined criteria too.

I'm fine with having the users enter the query criteria in a form too, but I
don't know how to make that happen either.

Clear and concise instructions will work too:)

Thanks.
 
Kate

Open a (new) form in design view. Add controls to hold the criteria you'll
need in your query/report.

Open the query in design view. Under one of the (to be selected-on) fields,
"point" to the relevant form's control with something like:

Forms!YourFormName!YourControlName

Repeat as needed. Note that the form has to be open for the query to find
the control.

Open the report in design view. Open the Properties window. Select the
query.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thanks Jeff.

This sounds easy enough, but I've got a couple of questions.

How exactly do I add "controls to hold the criteria"?

How do I "point" to the relevant form's control in the query?

Thanks,
Kate
 
Kate

Open the form in design view. Add a control. If you need two criteria, add
two controls.

In the design view of the query, in the "Selection Criterion" row, under the
field for which you wish to add a selection criterion, put something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top