Results 1 to 3 of 3
  1. #1
    Bkndbrown is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    22

    Date Filter to Crosstab Error

    I have a query that filters entries between dates that are entered on a Form called FLegalLanding


    the criteria formula I am using is "between [forms]![flegalLanding]![StartDateRng] and [forms]![flegalLanding]![EndDateRng]"
    This query works with no problems. I then go through another query and a union to manipulate the data and combine two queries. Again the output of these queries all work just fine.
    The only place in all of these queries that have dates or reference to the filtering is the original query

    Finally my Union feeds a query that is only there to turn it into a crosstab table.
    When I run this crosstab query I get an error
    "The Microsoft Access database engine does not recognize '[forms]![flegalLanding]![StartDateRng]'as a valid field name or expression."

    If I remove the criteria then the cross tab will work, if I replace that criteria with "between date() and date-120" it works (however this does not really solve my problem because I need to be able to change the dates).
    I tried changing it to "between [Enter Start Date] and [Enter End Date] and again all of the forms would work except for the cross tab which through about the same error.

    I'm sure I am missing something easy but I have gone through everything I could think of.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    ALL queries involved in a crosstab MUST have parameters entered.

    so in the base query using : between [forms]![flegalLanding]![StartDateRng] and [forms]![flegalLanding]![EndDateRng]"
    in qry design, click the PARAMETERS button and enter:
    [forms]![flegalLanding]![StartDateRng] date/time
    [forms]![flegalLanding]![EndDateRng] date/time

    save qry.

    all other queries in your union must have it to if it is used in the Crosstab. It's their thing.


  3. #3
    Bkndbrown is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    22
    Thank you I knew I was missing something stupid. That worked great.

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

Similar Threads

  1. Replies: 7
    Last Post: 12-30-2021, 02:29 PM
  2. Replies: 4
    Last Post: 11-20-2018, 11:57 PM
  3. Replies: 3
    Last Post: 02-21-2016, 05:44 PM
  4. Replies: 4
    Last Post: 04-21-2015, 07:12 PM
  5. Replies: 1
    Last Post: 02-04-2015, 03:53 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