Using a form to set a report filter - syntax error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using a form to set a date range for a report. The following syntax works
when the string includes the report name.
Reports![rptCourse_Description Brochure-test].Filter = "Date_Start between
#1/1/2001# and #12/12/2004#"
I've globally defined and set it in a sub as strReportTitle =
"rptCourse_Description Brochure-test"
I want to refer to this open report using the string'
The syntax below doesn't work.
Reports!strReportTitle.Filter = "Date_Start between #1/1/2001# and
#12/12/2004#"
Thanks in advance.
Chuckf201
 
Try:
Reports(strReportTitle).Filter = ...
Reports(strReportTitle).FilterOn = True
 
Allen,
Thanks - that did it.

Chuck

Allen Browne said:
Try:
Reports(strReportTitle).Filter = ...
Reports(strReportTitle).FilterOn = True

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Chuckf201 said:
I'm using a form to set a date range for a report. The following syntax
works
when the string includes the report name.
Reports![rptCourse_Description Brochure-test].Filter = "Date_Start between
#1/1/2001# and #12/12/2004#"
I've globally defined and set it in a sub as strReportTitle =
"rptCourse_Description Brochure-test"
I want to refer to this open report using the string'
The syntax below doesn't work.
Reports!strReportTitle.Filter = "Date_Start between #1/1/2001# and
#12/12/2004#"
Thanks in advance.
Chuckf201
 
Back
Top