Click on Project number to generate report

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a report "rptProjects" that I want run and filtered to show the
details of just one project based on the project number clicked on in a
summary form (continous form).

The target report is linked directly to the data table and contains
subreports linked to their respective data tables.

I can get the Projects form to open to the specific record fine using the
DoCmd.Openform, but DoCmd.Openreport does not work.

I have placed the projects' PKeys on both the summary form and within the
report and am using these in my code e.g REPORTID = Me!ReportID.

Can anyone help with the filter syntax or other coding?




QWERTY
 
John said:
I have a report "rptProjects" that I want run and filtered to show the
details of just one project based on the project number clicked on in a
summary form (continous form).

The target report is linked directly to the data table and contains
subreports linked to their respective data tables.

I can get the Projects form to open to the specific record fine using the
DoCmd.Openform, but DoCmd.Openreport does not work.

I have placed the projects' PKeys on both the summary form and within the
report and am using these in my code e.g REPORTID = Me!ReportID.

Can anyone help with the filter syntax or other coding?

If the report id is a numeric type field:
DoCmd.OpenReport "rptProjects", acViewPreview, , _
"REPORTID = " & Me!ReportID

If it's a Text field:
"REPORTID = '" & Me!ReportID & "' "
 
Back
Top