Preview & Print a single record

SteveA

New Member
Joined
Jun 8, 2004
Messages
12
Hi, help for a beginner please,

I have created a report based on data contained in a form. i have added a command button to the form, to preview the report.

I want to be able to preview and print the report for just the current record selected in the form, not all the records.

At the moment all that happens when I select the command button is the report opens at record 1. I then have to scroll through all the reports to find the one record I want to preview and print.

Probably very simple, but not for me :confused: Any help appreciated!

Steve A
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
You need to set up a filter for the report, so it restricts the report to the current record. I am assuming the following:
1. the report is based on a query (it should be, for maximum flexibility)
2. The form is MyForm
3. Each record on the form has a unique ID that identifies it. For example, if it's an Invoices form, you can use InvoiceID.

Go to the report, open in Design view, and edit the Record Source (select the Properties for the report, click the Data tab, click in the Record Source, and then click the builder (...) button in the Record Source row.
You'll be in query design view. Find the field that represents the unique ID on the form (eg InvoiceID in my example above). In the Criteria row, type [Forms]![MyForm]![InvoiceID] (substitute the real names for these samples, but keep the syntax the same). Save and close the report.

Now, when you launch the report, it should filter to just the report you are viewing in the form.

Denis
 
Upvote 0
I do have one more question. I notice if I enter a new record through the form, when I click the report button, the new info is not shown for that record. I have to close and reopen the Form before I am able to get a report for that new record?

I really need to be able to enter a new record, then print the report wothout closing the form. Is that possible?

SteveA
 
Upvote 0
Try going back one record -- that saves the record -- then back to the one you want to report on. It may be the problem, by the sound of it.

Denis
 
Upvote 0

Forum statistics

Threads
1,221,771
Messages
6,161,847
Members
451,723
Latest member
Rachetsely

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top