Print Report

T13v0hz

Registered User.
Local time
Tomorrow, 04:25
Joined
Apr 23, 2004
Messages
11
How would I make a report that only shows one page of information based on a query??

Can I make a query that can only display one row of data at a time then have a macro that requires the user to select the row (based on the primary key) that can show on a report?

Could I create a button on the form that switches from form to a report based on information from that form?

I do know that all these are possible, I'm just having a great deal of trouble getting something to work how I want.
I really need something like these because there will be thousands of reports which don't all need to be shown.
 
You can use the report's filter property to get only the data from the current record on the form. You need to base your filter criteria on a unique identifier for that record such as a primary key. This code would go in the open report command button:

DoCmd.OpenReport "MyReport", acPreview, , "[PrimaryKey] = " & Me.PrimaryKey

If the record's primary key is not in a bound control on the form, you'll have to add a non-visible text box so you can reference it from VBA.
 

Users who are viewing this thread

Back
Top Bottom