Printing Report From Form

m17347047711116

Registered User.
Local time
Today, 10:51
Joined
Feb 4, 2002
Messages
68
I have a form upon completion of the form i would like to be able to push a button to print the Report for that form.

Problem: i have inserted the print report button but when i push it is prints out all the records in my table, i only want it to print the report for the current record on the screen any suggestions ?
 
Base your report on a SQL statement and in the recordID or primary key field criteria insert

=Forms![FormName]![RecordID]

the report should only show the record you have open on your form
 
You can modify the code behind your button to read like this:

DoCmd.OpenReport "ReportName", , , "[RecordID] = & " Me![RecordID]
 
not sure if it makes a difference but as above with acnormal

DoCmd.OpenReport "your report", acViewNormal, , "[recordID] = " & Me![recordID]

Put that behind the on click and it will print the report without opening it. I presume you dont want to see the report just print it. If you want to view te report first change acviewnormal for acPreview

smile.gif
 

Users who are viewing this thread

Back
Top Bottom