printing a report for a single record

microwize

New member
Local time
Today, 14:49
Joined
Nov 8, 2001
Messages
5
I'm new to access. I'm beating my brains in and reading all the posts that relate to this. This is my final concoction and it doesn't work.

DoCmd.OpenReport "CustomerFaceReport", acPreview, , "[RefNum] = '" & Me.Customers.RefNum & "'"

my RefNum is alphaNumberic

Thanks in advance
 
Is Customers the form? Not sure why you have Customers.RefNum


DoCmd.OpenReport "CustomerFaceReport", acPreview, , "[RefNum] = '" & Me.RefNum &"'"

or

DoCmd.OpenReport "CustomerFaceReport", acPreview, , "[RefNum] = '" & Forms!Customer![RefNum] &"'"
 
If you are in a form and using a command button to print a report this might help.

For each field that you want to bring over from the form, add the following line in the OnOpen event of the report;

[MyField]=[Forms]![formname]![fieldname]

Where [MyField] is the name of the given to each unbound field on the report.

hth, GGuy
 
Thanks DBL!

This one did the trick. I know it was small but critical.

DoCmd.OpenReport "CustomerFaceReport", acPreview, , "[RefNum] = '" & Me.RefNum &"'"
 

Users who are viewing this thread

Back
Top Bottom