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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2003 report to filter between dates

Status
Not open for further replies.

SamsFriend

Technical User
Sep 9, 2008
8
Hi I'm having trouble creating a form with a user entered start date and finish date. When the user clicks the button I would like a report to filter data from a query between the dates specified by the user. I have created the query, a report and the form. I have tried to put the following into the Query Parameters :-
Between forms!frm_TestDates!txt_StartDate And forms!frm_TestDates!txt_FinishDate
I keep getting this message "Invalid bracketing of names [Between forms!frm_TestDates!txt_StartDate And forms!frm_TestDates!txt_FinishDate]
but I have tried all different ways.
I'd really appreciate some help please.
 
In the Query's Design View, try putting Between [Forms]![frm_TestDates]![txt_StartDate] And [Forms]![frm_TestDates]![txt_FinishDate] in the Date columns criteria line. Hopefully that will help.
 
Thank you, now I am at least getting headings but no data.
 
Well, that's progress. That means that there was no data that fit the criteria. It's better than an error generally.

If you run the query from the query window (double-click it or highlight and click Open) without frm_Test_Dates being open, it should prompt you for dates (called [Forms]![frm_TestDates]![txt_StartDate] And [Forms]![frm_TestDates]![txt_FinishDate]).

When you manually type dates into those prompts, do you get data in the results?

If not, is there data that should pull (records with dates in the range)? One way to check this is to run it with the critera removed to see what it gets for all dates.

 
Hi,

The criteria of this has changed. I now have a table named tbl_Data, A report rpt_ByDate and a form frm_ByDate. The form has a combo box on it called cmb_Date. Is it possible to print a report of records in the table matching only the date chosen in the combo box? Any help would be appreciated, I'm pulling my hair out :)

Thank you
 
I have put the following into the After Update Event on the date selection combo box

Private Sub cmb_Date_AfterUpdate()
DoCmd.ShowAllRecords
Me!**NOT SURE WHAT TO PUT HERE**.SetFocus
DoCmd.FindRecord Me!cmb_Date

Me!cmb_Date.Value = ""
End Sub

I had this running and lost it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top