OpenReport + Current Record Only

P

paquer

Ive read like 20 other posts regarding this issue & tried all the code
variations provided in them although I cannot get the OpenReport
command to open the report with only the current record.
The following is the code that is always the "one that works" as ive
read in the other posts;

DoCmd.OpenReport "Report_Name", acViewPreview, , "Report_ID_Field = ""
& Me.Form_ID_Field"""

For me it brings up a blank report each time.

This next variation prompts me for the 'Form Field' parameter

DoCmd.OpenReport "Report_Name", acViewPreview, , "Report_ID_Field =
Me.Form_ID_Field"

All the syntax for the field names is correct. Im using fields that
are PK values, ive tried switching the Form Field & Report field
around....Nothing at all seems to work.

please help, this is driving me nuts
 
P

paquer

On the second variation i noted, it asks me for the parameter of the
Form filed I am using.
Once entered it does bring up the report with only the 1 record. This
is the closest Ive been able to get.
 
D

Douglas J. Steele

DoCmd.OpenReport "Report_Name", acViewPreview, , "Report_ID_Field = """ &
Me.Form_ID_Field & """"

That's 3 double quotes in front of & Me.Form_ID_Field, and 4 double quotes
after.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top