Results 1 to 6 of 6
  1. #1
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215

    Filtering Crosstab Queries

    I have a crosstab query.

    There is a field for row headings that specifies QUARTER (Q1,Q2, Q3,Q4) and another field for row headings that specifies YEAR(2015,2016,...etc)



    I want to be able to have the user input the criteria in to a box and filter the crosstab query to then display the filtered results.

    Right now on my column headings I have MONTH.

    When I try to reference the form in the criteria, I always get the error

    "The Microsoft Database Engine does not recognize ..... as a valid field name or expression"

    Does this mean that you can not filter crosstab queries?

    ​Thanks,

  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,652
    See if this helps:

    Crosstab Query with a Parameter
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    This is getting me on the right track... but I need an example. This article doesn't give one. I haven't the slightest indication of what to put into the Query Parameters box and/or the Criteria section of the query itself.

    Usually, I reference the unbounded form within the criteria section - this doesn't work. So what is it that I have to put in the Query Parameters box?

    This article does not illustrate that.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Here is another reference http://allenbrowne.com/ser-67.html#Param
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    Okay. I see what it means to reference a control on a form within the Parameters box.

    How does the Query itself actually know what to filter, though?

    For instance,

    If I type [Forms].[Forms1].[StartDate] of datatype Date/Time into the Parameters box.

    The query itself has no idea where to place that actual criteria, no? What do I put within the criteria section next within the query?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I think you build the WHERE clause as normal with reference to the form control. (I don't have need for CROSSTAB queries, so try it and let me know.)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Combine two crosstab queries
    By Ray67 in forum Queries
    Replies: 2
    Last Post: 10-18-2012, 01:24 PM
  2. CrossTab Queries
    By wanware in forum Access
    Replies: 1
    Last Post: 06-26-2012, 11:47 AM
  3. Combining crosstab Queries
    By Garito100 in forum Queries
    Replies: 0
    Last Post: 10-22-2010, 02:26 AM
  4. Combine crosstab queries
    By thart21 in forum Queries
    Replies: 3
    Last Post: 05-03-2010, 10:36 AM
  5. Crosstab Queries
    By albst130 in forum Queries
    Replies: 0
    Last Post: 03-07-2007, 09:32 AM

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