Generating a report that includes only the current form data

E

Ed3

I need to generate a report from a form using a control button that only uses
the data currently displayed on the form. I have the basics of form building
down, but I keep getting every record in my data table. Thanks.

Ed3
 
R

Rick Brandt

Ed3 said:
I need to generate a report from a form using a control button that
only uses the data currently displayed on the form. I have the
basics of form building down, but I keep getting every record in my
data table. Thanks.

Ed3

The fourth argument of the OpenReport method is for an optional WHERE clause
(without the word "where"). You need to put an expression in that argument that
filters the report on the values in the form that will select that record. If
there is a single primary key then that is all you need...

DoCmd.OpenReport "ReportName",,,"PKField = " & Me.PKField
 
Top