Results 1 to 2 of 2
  1. #1
    pokeycameron is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2014
    Location
    Alaska
    Posts
    1

    Using Date Range in a Form to Change a Report from a Crosstab Query

    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.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Passing A Date Range From Form To Report
    By JeffGeorge in forum Reports
    Replies: 3
    Last Post: 03-11-2014, 12:50 PM
  2. Replies: 9
    Last Post: 02-21-2014, 06:02 PM
  3. Crosstab query with date range (2 years)
    By Cassim in forum Queries
    Replies: 7
    Last Post: 11-11-2013, 08:48 AM
  4. Replies: 17
    Last Post: 08-15-2012, 04:27 PM
  5. Date range query from form
    By Steve Barnes in forum Queries
    Replies: 2
    Last Post: 07-29-2010, 07:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums