How Do I Get a Dynamic "Single Person" Report in Access 2003?

G

Guest

I have a database in Access 2003 with a number of tables, queries and
reports.

One of the reports gives a listing of all people in the database and what
functions they participate in.

How do I set up a special report (or query) so that I can enter an
individual's name and then get this report only for that person and not for
everyone in the database?

I'm sorry if this seems overly simple, but I'm stumped.

Thanks
Kit Marty
 
J

John Vinson

I have a database in Access 2003 with a number of tables, queries and
reports.

One of the reports gives a listing of all people in the database and what
functions they participate in.

How do I set up a special report (or query) so that I can enter an
individual's name and then get this report only for that person and not for
everyone in the database?

I'm sorry if this seems overly simple, but I'm stumped.

A couple of ways:

Use a Parameter Query with a criterion on the PersonID of the person
you're interested in. One good way to do this is to use a Form
(frmCrit let's call it) with a combo box, cboPerson, allowing the user
to select a name. Use a criterion in the query of

=Forms!frmCrit!cboPerson

Base the Report on this combo, and open the Report from a command
button on frmCrit, or even in the AfterUpdate event of cboPerson.

Or, use your exisiting report and query, just pass the person's ID in
the OpenReport code. The Wixard code will have a variable strCriteria;
just set it to the criteria to open the desired record:

strCriteria = "[PersonID] = " & Me!cboPerson
DoCmd.OpenReport strDocument, , , strCriteria

The exact syntax will of course depend on your table structure and
your fieldnames.

John W. Vinson[MVP]
 

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