Using parameters with queries and reports

S

SJUCatch27

I referred to the article in the Subject above and followed it step-by-step,
but I can't seem to get my database right. I created a form for a complex
query with multiple parameters. Now, I linked the same form to a report so
that when I ask for the report, the form comes up, the user types the
parameters of the search, the query runs in the background, and the results
are put onto a form. Again, I followed it step-by-step in the article above,
but the error I keep getting is that when I click onto the report, the form
pops up. I enter the data into the form and then the original dialog boxes
pop up as if you were running the query without the form. If I type the
information into that, the report comes out perfectly ... but again, I would
prefer it be less complicated and utilize the form that I have built for it.
Thank you and I hope someone can please help me with this.
 
M

Marshall Barton

SJUCatch27 said:
I referred to the article in the Subject above and followed it step-by-step,
but I can't seem to get my database right. I created a form for a complex
query with multiple parameters. Now, I linked the same form to a report so
that when I ask for the report, the form comes up, the user types the
parameters of the search, the query runs in the background, and the results
are put onto a form. Again, I followed it step-by-step in the article above,
but the error I keep getting is that when I click onto the report, the form
pops up. I enter the data into the form and then the original dialog boxes
pop up as if you were running the query without the form. If I type the
information into that, the report comes out perfectly ... but again, I would
prefer it be less complicated and utilize the form that I have built for it.


It sounds like you are opening the form from somewhere in
the report. While that is possible, it is complicated to
make it work correctly. The common, relatively simple,
approach is to open the form first, enter the parameter
values in text boxes and then use a button to open the
report.
 
S

SJUCatch27

Thank you for responding to my post earlier this afternoon. I was hoping you
could explain to me or direct me to an article or link that could explain
creating a button for the form to run the query and go to report - like you
had mentioned in the post. I apologize for my persistance on this; it is just
that I am an intern and was basically given this Access project to do with
very little training in the program. I have taught myself through most of it
so far, but I am by no means a programmer and have battled my entire way
through it. I am guessing it involves some type of code and that is
absolutely fine, I am just hoping you could somewhat direct me to the simpler
solution. Thank you again!
 
M

Marshall Barton

I can't seem to find an article for such a basic activity.
Take a look around in the NorthWind sample database that
comes with Access for all kinds of examples.

Actually, it should be even simpler than that, just open
your form in design view, make sure the magic wand in the
Tool Box toolbar is turned on and then add a command button
to the form. Select the open report wizard to have the code
for the button generated automatically. Then all you need
is to remove the form stuff from the report.

This way, you open the form, enter the values on the form,
click on the new button and the report should appear.
 

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