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
 

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