open a report based on a field (1 Viewer)

COMP

Registered User.
Local time
Yesterday, 17:38
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??
 

joepineapples

Registered User.
Local time
Today, 01:38
Joined
Apr 28, 2006
Messages
29
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

Top Bottom