Results 1 to 5 of 5
  1. #1
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    145

    Parameter Query not displaying results


    I am trying to design a parameter query that gets a value from a combobox on a form. The results should be records with the value in the combobox or all records if * is the value in the combo box. When I run the query I get no results. If I enter a value directly in the query it works as expected. Note: The values look like dates but they are not. They are Short Text. I couldn't figure out how to have a value for all dates in my combobox if the fields were configured as DateTime. Note 2: The only dates currently in the table are 2/08/2026, 2/12/2026, 2/17/2026 and 2/20/2026. Any help is appreciated DB Attached
    Attached Files Attached Files

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    CortinaDateFilter is 3 columns. You are refering to the 1st column in your code which is the PK, but displaying the second column on the form which is the date.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I avoid parameter queries and prefer to apply filter to form or report.

    Why are you using GROUP BY? There are no aggregate functions and same number of records return without GROUP BY.

    Why would you need all dates in combobox? Why not just dates that exist in data?

    As Moke noted, value of combobox is ID, not CortinaEventDate. Either change query to filter ID field or modify combobox. I tested filtering on ID and doesn't work with *. Need to save event date or event date ID into all event records.

    Don't really need dummy * record in table. RowSource can be built with UNION.
    SELECT EventDate FROM ContinaEventDates
    UNION SELECT "*" FROM ContinaEventDates;

    or this

    SELECT [CortinaStartDate] FROM CortinaEvents WHERE NOT CortinaStartDate IS NULL
    UNION SELECT "*" FROM [CortinaEvents];
    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.

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,820
    Hi

    You have 8 Tables with no relationships set between any of them?

    What is the purpose of the database?

  5. #5
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    145
    Jun7 and Moke123: Modifying the combo box worked. I will look into the Union query option. Thanks!

    Mike60smart: This is a database for me to track when and where events happen in the Olympics. I testing on Cortina, Italy 2026 so that I am ready for LA 2028 which I plan on attending. It is still in the early stages of conception but I wanted to figure out some functions that I know I will want way ahead of time. There is still data and possibly some fields to be added. Thanks for your help!

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

Similar Threads

  1. Replies: 10
    Last Post: 12-16-2022, 07:29 AM
  2. Replies: 3
    Last Post: 05-19-2015, 03:04 PM
  3. Replies: 3
    Last Post: 07-21-2014, 04:02 PM
  4. Replies: 9
    Last Post: 12-13-2010, 09:25 PM
  5. Replies: 0
    Last Post: 03-31-2010, 07:52 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