Results 1 to 6 of 6
  1. #1
    Vaporhead is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2024
    Posts
    13

    Query criteria bvia combobox

    Hello.

    I have a form [frmStoreProfile] with a combo box [cbolocation]. The combo works just fine within the form, but when I use the [cbolocation] field for a query criteria, I get no results. If I close the form and run the query, I get the expected results after I type in the [cbolocation] parameter, but with the form open and run the query, I get nothing.

    My WHERE clause in the query is: WHERE (((tblMishaps.[Store Location])=[Forms]![frmStoreProfile]![cboLocation]))



    It seems like the query is not pulling the cbolocation value from the form.....


    Mark

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Is the form open when you run the query? Result??

  3. #3
    Vaporhead is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2024
    Posts
    13
    Yes, the form is open and the appropriate combobox selection entered. The query will show now results.

  4. #4
    Join Date
    Apr 2017
    Posts
    1,680
    What kind of info contains tblMishaps.[Store Location] (location id, or some coordinates, or location description)? And is it's format long integer, or number, or text?
    What is the RowSource of combo, and which column of row source is BoundColumn? And what is format of BoundColumn column, in case RowSource is a query?

    When your query doesn't get any results, the most probable reason is, you compare non-comparable values in WHERE clause.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't use parameterized queries. I use VBA to build filter criteria and apply to form or report.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  6. #6
    Vaporhead is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2024
    Posts
    13
    Sorry for not replying back. I ended up recreating the query it it's functioning fine now....

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

Similar Threads

  1. Replies: 24
    Last Post: 08-25-2020, 10:44 PM
  2. Replies: 2
    Last Post: 07-08-2020, 01:20 PM
  3. Replies: 7
    Last Post: 11-11-2014, 06:10 PM
  4. Combobox value as query criteria
    By tylerg11 in forum Forms
    Replies: 5
    Last Post: 06-25-2012, 10:45 AM
  5. Query criteria retrieved from a Form combobox?
    By blacksaibot in forum Queries
    Replies: 1
    Last Post: 01-27-2010, 10:18 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