Click on Project number to generate report

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




0
Utf
1/8/2008 2:05:00 AM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
773 Views

Similar Articles

[PageSpeed] 22

John wrote:

>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 & "' "

-- 
Marsh
MVP [MS Access]
0
Marshall
1/8/2008 2:48:25 AM
Thanks Marshall - I had the wrong syntax, your numeric suggestion did the 
trick.

"Marshall Barton" wrote:

> John wrote:
> 
> >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 & "' "
> 
> -- 
> Marsh
> MVP [MS Access]
> 
0
Utf
1/8/2008 4:35:04 PM
Reply:

Similar Artilces: