I would like to gerate a report from a Crosstab Query that is controlled from a date range entered on a form. I have two unbound text boxes in a form. One for Start Date and the other for End Date. I would like to have a button to create a preview of the report using the date range provided in the form.
Thanks to Allen Browne's commentary on the net, I have been able to use the boxes and date range for a report that pulls directly from the data table. Although, I need something more like a Crosstab Query for some more reports.
I have tried making a normal query with dates, "Entry Date" is the name of the field. From this query, I have made the Crosstab query. I have tried using the "Between...And" command in the Criteria section of Entry Date and keep getting an error. I have searched the internet and it seems to be the common solution. When I have tried, I continually get an error saying
"The Microsoft Office Access database engine does not recognize '[Forms]![Reports Form]![textStartDate]' as a valid field name or expression."
The Criteria is exactly as follows:
Between [Forms]![Reports Form]![txtStartDate] And [Forms]![Reports Form]![txtEndDate]
Access automatically adds the brackets around "Forms" regardless of how I have tried to change it. I have tried to change it in the SQL view, expression builder and directly.
I have made various attempts in VBA, but have similar problems with trying to use the date range and accessing the "Date Entry" in the query.
Thank you for any assistance in advance.