Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter on a report

Status
Not open for further replies.

ptiernan

IS-IT--Management
Apr 29, 2003
55
GB
Help

I have a problem in sending a filter to a report.

I have a form set up to act as a small query builder with several option boxes and a start date and an end date.

Within VBA on the form I create a txt field where I create the WhereCondition for use in the DoCmd.OpenReport.

The report give seems to ignore the StartDate but is ok on the EndDate.

My code in my form for the date is

'Set up the where condition
where_stat = "Start_Date between #" & Me.StartDate & "# and #" & Me.EndDate & "#"

'Open the report
DoCmd.OpenReport "R_Client_Into_Training", acViewPreview, , where_stat

Start_Date is within the RecordSource of R_Client_Into_Training. StartDate and EndDate are the user input.

Any ideas welcome.

Much Thanks
Paul Tiernan
 
If the StartDate is 01/08/2003 and EndDate 01/01/2004 this shall give me report with records between 01/01/2003 and 01/01/2004.
 
The dates must be expressed as #m/d/yyyy#

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top