Print only report for current record

jamphan

Registered User.
Local time
Today, 09:17
Joined
Dec 28, 2004
Messages
143
I have a report that is tied to a table. On my table form I have a button that prints the report. Is there a way to only print the report for the current record showing on my form?
 
I have a report that is tied to a table. On my table form I have a button that prints the report. Is there a way to only print the report for the current record showing on my form?


Change the click event behind the button to this:
Code:
DoCmd.OpenReport "YourReportNameHere", acViewNormal, , "[YourPrimaryKeyFieldNameHere]=" & Me!YourPrimaryKeyFieldNameHere

remember to change the parts that I have that include "NameHere" to the actual names of your objects. So, if you have a report named "Receipts" you would change "YourReportNameHere" to "Receipts" and include the quotation marks.

Make sure you are also doing this code in the VBA window and not in the properties dialog. The event in the control's properties should say [EventProcedure].

Let me know if that isn't clear.
 

Users who are viewing this thread

Back
Top Bottom