Sending filtered records to a report

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Hi,

Researched for hours and getting nowhere!

I have designed a search form for users to allow them to
filter the records on a subform. How do I pass the
filtered records only on the subform to a report for
printing.

The filtered records are produced by a SQL statement.
(SELECT * FROM tblCalendarOfEvents Where [Date]
#3/1/2004# AND [Date]<#3/31/2004#).

Thanks in advance

Tony
 
DoCmd.OpenReport "ReportName",acViewPreview ,,"[Date]
#3/1/2004# AND [Date]<#3/31/2004#"

Also note, by using Date as a field name, you have to
potential of running into problems as that is a reserved
word in Access.

Chris
-----Original Message-----
Hi,

Researched for hours and getting nowhere!

I have designed a search form for users to allow them to
filter the records on a subform. How do I pass the
filtered records only on the subform to a report for
printing.

The filtered records are produced by a SQL statement.
(SELECT * FROM tblCalendarOfEvents Where [Date]
#3/1/2004# AND [Date]<#3/31/2004#).

Thanks in advance

Tony
.
 
Thank you Chris.
Thanks for the tip about the date field.
Have made the necessary changes.

Tony
-----Original Message-----
DoCmd.OpenReport "ReportName",acViewPreview ,,"[Date]
#3/1/2004# AND [Date]<#3/31/2004#"

Also note, by using Date as a field name, you have to
potential of running into problems as that is a reserved
word in Access.

Chris
-----Original Message-----
Hi,

Researched for hours and getting nowhere!

I have designed a search form for users to allow them to
filter the records on a subform. How do I pass the
filtered records only on the subform to a report for
printing.

The filtered records are produced by a SQL statement.
(SELECT * FROM tblCalendarOfEvents Where [Date]
#3/1/2004# AND [Date]<#3/31/2004#).

Thanks in advance

Tony
.
.
 
Back
Top