Results 1 to 3 of 3
  1. #1
    jtish is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    2

    Crosstab Query based on Multi-List form selection

    I am trying to create a crosstab query based on inputs selected on a form. One of the key fields is a list of Cities that allows for multiple selections. This data feeds into a crosstab query; however, the existing SQL criteria language (Where clause) pulls all Cities as opposed to the ones I selected in the form. I have highlighted the section that is failing me in red font below. I suppose it should include an IN clause; however, I do not know how to get the multi-list box selections to auto-populate into the criteria language. Any guidance would be most appreciated. Regards, Jeff

    PARAMETERS [Forms].[frmClientSearch].[txtFilterMainName] Text ( 255 ), [Forms].[frmClientSearch].[txtFilterCity] Text ( 255 ), [Forms].[frmClientSearch].[txtStartDate] DateTime, [Forms].[frmClientSearch].[txtEndDate] DateTime, [Forms].[frmClientSearch].[txtfilterZip] Text ( 255 ), [Forms].[frmClientSearch].[txtFilterAddKey] Text ( 255 ), [Forms].[frmClientSearch].[cboFilterMinTax] Currency;
    TRANSFORM Sum([Tax]/0.14) AS [Alcohol Sales]
    SELECT tblClient.MainName AS Restaurant, tblClient.AddressL1 AS Address, tblClient.City, tblClient.Zip, Sum([Tax]/0.14) AS [Total of Alcohol Sales]
    FROM tblClient
    WHERE (((tblClient.MainName) Like "*" & [Forms].[frmClientSearch].[txtFilterMainName] & "*") AND ((tblClient.City) Like "*" & [Forms].[frmClientSearch].[txtFilterCity] & "*") AND ((tblClient.Zip) Like "*" & [Forms].[frmClientSearch].[txtfilterZip] & "*") AND ((tblClient.Tax)>[Forms].[frmClientSearch].[cboFilterMinTax]) AND ((tblClient.AddressL1) Like "*" & [Forms].[frmClientSearch].[txtFilterAddKey] & "*") AND ((tblClient.EnteredOn) Between [Forms].[frmClientSearch].[txtStartDate] And [Forms].[frmClientSearch].[txtEndDate]))
    GROUP BY tblClient.MainName, tblClient.AddressL1, tblClient.City, tblClient.Zip
    ORDER BY tblClient.MainName, tblClient.EnteredOn
    PIVOT tblClient.EnteredOn;

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529

  3. #3
    jtish is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    2

    Cross-Post Mea Culpa and plea for assistance

    My apologies for not following cross-post etiquette. I'd still very much appreciate any guidance that can be offered for my crosstab/multi-list situation. Please direct responses to my original entry at http://www.access-programmers.co.uk/...d.php?t=225914

    Thanks so much,

    Jeff

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

Similar Threads

  1. Multi-selection from list box to reports
    By SgtSaunders69 in forum Forms
    Replies: 3
    Last Post: 03-02-2012, 09:56 AM
  2. Replies: 8
    Last Post: 12-22-2010, 08:12 AM
  3. Update table based on List Box selection
    By tpcervelo in forum Forms
    Replies: 0
    Last Post: 11-04-2010, 01:32 PM
  4. Replies: 2
    Last Post: 08-03-2010, 10:16 AM
  5. Replies: 1
    Last Post: 03-09-2006, 12:12 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