open a report based on a field

COMP

Registered User.
Local time
Today, 00:07
Joined
Jul 20, 2009
Messages
61
hi guys i am trying to open a report based on a certain field. So i what i am trying to do is when you press the open form button it automatically looks at the certain field the project reference field and opens up the report for that project reference. any ideas how to do this??
 
If I understand this right ... You want to open a report where the report is filtered to only include records Matching same Reference Number on the form.

You can do something like this:

In your form create a command button then add the following code to the on Click Event.

Code:
DoCmd.OpenReport "Name of your report", acPreview, , "[Project_Reference_Number]=" & Me![Project_Reference_Number] & " "



*Note - you would want to add a bit of error handling to this!
 

Users who are viewing this thread

Back
Top Bottom