Generate a Report based on 1 Record (1 Viewer)

S

Sheila

Guest
I need to generate a report that will display and print only one record. What is the best way to do this? I hope to utilize a button/macro to make this easier for Staff to print a report of only the current record. Any ideas???? -Thank you!
 

Fornatian

Dim Person
Local time
Today, 17:33
Joined
Sep 1, 2000
Messages
1,396
The easiest way to do this is to build a query that will return only the current record, then base that report on the query.

So if you have a table with a primary key called [CustomerID] that is the field you want to use to filter the records in the query.

1st Step: Put all the fields in the query that you have/want in the report
2nd Step: Under the criteria row of the primary key field(using the example above it wuld be [CustomerID]), right click in the field and choose build, in the expression builder, double click FORMS in the first column & choose ALL FORMS, click on the name of your form, in the second column choose FIELD LIST - the third column will then show a list of fields that are on that particular form. Click the matching field. In the top you should have something that looks like:

Forms!MyFormName!MyFormField

Choose OK.
The criteria row will now show Forms!MyFormName!MyFormField which means it will take its value from the form when the form is open.

Bob's your uncle, the query is built.
If the report is already built change the control source of the report to the name of query, otherwise just build a new report using the wizard based on the query.

Now all that remains to be done is put a button on the form which opens the report.

This isn't the most efficient way of doing it but it works.

Hope all that makes sense to you.

Phew!

Ian
 

Users who are viewing this thread

Top Bottom