Results 1 to 7 of 7
  1. #1
    dawnnolan54 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3

    applying criteria to 2 fields in different tables

    i am trying to create a query in which only records will appear if a certain condition is True in 1 table or a certain condition is True in another table. I have them linked by id, but how do i formulate the query to check for the "or" conditions on 2 different fields in 2 different tables.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Use the query grid, add your tables, identify the fields, establish the join , add the criteria -- use different lines for the criteria to get the OR condition.

  3. #3
    dawnnolan54 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3
    I think I am doing that. Attached is screenshot of query design view where i want to display the fields in all records in names that members are true and all records in pubs that defend-comp is true. I am not getting the results i want.Click image for larger version. 

Name:	access query.jpg 
Views:	6 
Size:	144.2 KB 
ID:	21916

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    What is in email criteria?
    You have something in the grid that you didn't mention in your post.

    "" is not the same as IS NOT NULL

  5. #5
    dawnnolan54 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Posts
    3
    i was checking if the field was blank or not or contained something. Is that not the correct way?

  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,770
    If you allow empty strings in a text field, then the field could have a (visible) alphanumeric value, or could have (not visible) empty string value, or could be Null. Null means there is absolutely nothing, not even empty string.

    I never allow empty strings in fields. So I use Is Not Null as criteria.
    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.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    @dawn,

    You have to spend some time on the basics. Some of these are not self evident.

    see this as a start.
    Use Google or Bing to research
    Empty string
    ZLS
    NULL
    data type in the context of MSACCESS

    Good luck.

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

Similar Threads

  1. Merging fields and applying hyperlink in report
    By funkmasterjo_d in forum Reports
    Replies: 3
    Last Post: 12-27-2013, 02:34 PM
  2. Replies: 4
    Last Post: 04-22-2013, 06:45 AM
  3. Apply Filter 2 criteria not applying
    By ahightower in forum Forms
    Replies: 4
    Last Post: 07-28-2011, 03:31 PM
  4. Replies: 2
    Last Post: 05-09-2011, 06:45 PM
  5. Search By Criteria - Flexible Criteria Fields
    By lilanngel in forum Access
    Replies: 0
    Last Post: 03-16-2011, 06:25 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