Robert M
06-24-2009, 03:24 PM
In the docmd.openreport "Report Name",,,Where Clause
I am unable to have the where clause get the right record to print. When I push the button to print in my form I get ALL the records instead of the one I want. Thank you for your help on this matter.
In the docmd.openreport "Report Name",,,Where Clause
I am unable to have the where clause get the right record to print. When I push the button to print in my form I get ALL the records instead of the one I want. Thank you for your help on this matter.
If you want the current record then it would be something like this:
DoCmd.OpenReport "ReportName", acViewNormal, , "[YourIDFieldOnReport] = " & Me!YourPrimaryKeyFieldForThatRecord
pbaldy
06-24-2009, 04:00 PM
Here's the syntax if the data type of the field isn't numeric:
http://www.baldyweb.com/wherecondition.htm
Robert M
06-25-2009, 05:12 AM
Thank you pbaldy, that is exactly what I needed. The syntaxt gets me every time.
Robert M
pbaldy
06-25-2009, 06:58 AM
No problem, SOS and I were glad to help. The syntax can be tricky until you've done it a few times.