QUERY/REPORT

J

Jim

I have a query which pulls up records by client#. I can populate one
report based on one search. Do I have to design a report for each
query by client#. Is there a way to use the same report format for
each query done by client#?
 
J

Jim

You would filter the report datasource on the client #.  There is more than
one way to do this.  Perhaps more details on what you're doing.

Bonniehttp://www.dataplus-svc.com

Im not sure how to explain this more clearly but I have ran a query
based on client# and I have successfully ran a report based on that
query. Now I want to change the client# in the query and run another
report, using the same report format. I have changed the query to the
new client# but I can not populate the report based on the new
client#. I will have hundreds of client#s and I wouldn't want to have
to design a report for each one.
 
J

John W. Vinson

Im not sure how to explain this more clearly but I have ran a query
based on client# and I have successfully ran a report based on that
query. Now I want to change the client# in the query and run another
report, using the same report format.

You need to use one of Access' most powerful features: a Parameter Query.

Rather than using a criterion like "A123" to select client A123, you can use a
criterion

[Enter client number:]

in square brackets. Base the report on this QUery (or change your existing
report's Recordsource property to the name of this query). Now when you run
the report it will prompt you to enter a client number, and report on whatever
client you type in.

Even better, create an unbound (nothing in its Control Source) Combo Box on a
form, allowing the user to select a client ID from a list. Use

=[Forms]![NameOfForm]![NameOfCombo]

as the criterion. You can put a command button on the form to open the report,
or open it in the combo box's AfterUpdate event.
 
J

Jim

Hello John - hope you're doing well.

Exactly!




You need to use one of Access' most powerful features: a Parameter Query..
Rather than using a criterion like "A123" to select client A123, you canuse a
criterion
[Enter client number:]
in square brackets. Base the report on this QUery (or change your existing
report's Recordsource property to the name of this query). Now when you run
the report it will prompt you to enter a client number, and report on whatever
client you type in.
Even better, create an unbound (nothing in its Control Source) Combo Boxon a
form, allowing the user to select a client ID from a list. Use
=[Forms]![NameOfForm]![NameOfCombo]

as the criterion. You can put a command button on the form to open the report,
or open it in the combo box's AfterUpdate event.

Thanks for your help. The parameter query works great. PC Professor
just doesn't explain everything. lol
 

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