Results 1 to 3 of 3
  1. #1
    JTBrown1689 is offline Novice
    Windows 10 Access 2021
    Join Date
    Feb 2024
    Posts
    1

    Table List as a Query Criteria as "OR"

    I have a Table that uses a Lookup to identify the different MembershipTypes. My queries are all base one or multiple values of that Lookup.
    My current query set of criteria, examples as follows: 1, 1 or 2, >4, 1 or 2 or 3 or 7.


    My issue is that if I add a new item to the Lookup, I have to update the Query to ensure it is included. I know I can use a table item in the criteria, but being a numeric field, my attempts to include the "or" is text and I am receiving a "Type Mismatch in Expression" which I understand as Text versus Numeric.
    Any help or ideas to try would be appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Quote Originally Posted by JTBrown1689 View Post
    I know I can use a table item in the criteria, but being a numeric field, my attempts to include the "or" is text and I am receiving a "Type Mismatch in Expression" which I understand as Text versus Numeric.
    I don't follow how you "include" the or operator and get this error.

    Provide your SQL for analysis. You can even provide db - follow instructions at bottom of my post.

    I prefer to use VBA to build filter criteria and apply to form or report. Review: http://allenbrowne.com/ser-62.html
    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.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    For other than the >4 criteria, you could use IN().
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Simple table relationships ("faces" to "spaces" to "chairs")
    By skydivetom in forum Database Design
    Replies: 36
    Last Post: 07-20-2019, 01:49 PM
  2. Replies: 2
    Last Post: 04-12-2016, 12:58 PM
  3. Replies: 8
    Last Post: 07-13-2015, 12:51 PM
  4. Replies: 3
    Last Post: 12-06-2014, 03:59 AM
  5. Replies: 11
    Last Post: 03-29-2012, 02:32 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