Results 1 to 7 of 7
  1. #1
    MichaelWR90 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    8

    Access Query | Advanced help

    Good afternoon all,



    Here's what I'm trying to accomplish:

    A: Description | B: Name | C: Box Number

    Above are example headers of my columns. I'm looking for specific names/keywords from A & B, BUT I also want all of the Box Number hits that appear from the search of A & B.

    Basically:


    Search Column A for "keyword" AND Column B for "name" - additionally, I want all of the entries for Box 1 if that Box 1 is part of the initial A & B search hit (regardless of having the keyword/name).

    If this sounds confusing, I will try to re-word it

    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    select * from table where [Description] like *forms!myForm!txtKeyword* and [name]=forms!myForm!txtName

  3. #3
    MichaelWR90 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    8
    I'm writing this in the SQL View?

    SELECT * FROM [IDD Master] WHERE [Description of Box/Contents] Like *forms!myForm!txtKeyword* and [Name]=forms!myForm!txtName

    So IDD Master is my table, [Description of Box/Contents] is my field A, [Name] is my field B, and field C is [Box Number]

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Is this being done in a query or in VBA? Why is A using LIKE but B using EQUAL TO? Is this how you want it?

  5. #5
    MichaelWR90 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    8
    Honestly, I don't even know where to start to accomplish what I need. I just want to search A & B, and if C has duplicates that aren't in A&B search, I want to list them as well.

  6. #6
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Maybe give some sample data of what would be in A,B,C and what you want the results would look like.

  7. #7
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    - create a form where you enter the values you want - two text boxes, one for A and one for B.
    - create query1 using table - select A, B and box
    - in the criteria line for A, Forms!FormName!Atextboxname
    - in the criteria line for B, Forms!FormName!Btextboxname

    - create query2 using table and query1, make a join between them on box
    - select A, B, box from table

    - create query3:
    SELECT * FROM query1
    UNION SELECT * FROM query2;

    - create query4 based on query3
    - select all fields
    - go to SQL view, add the word SELECT DISTINCT ....

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

Similar Threads

  1. Need help with an advanced append query
    By jpihpa in forum Import/Export Data
    Replies: 6
    Last Post: 04-19-2012, 10:22 AM
  2. Advanced CountIf Query
    By therzakid in forum Queries
    Replies: 2
    Last Post: 07-27-2011, 10:45 PM
  3. Advanced Query
    By Cined in forum Queries
    Replies: 1
    Last Post: 03-04-2011, 03:40 PM
  4. Advanced Query
    By Exwarrior187 in forum Queries
    Replies: 6
    Last Post: 01-14-2011, 10:11 AM
  5. Access versus FileMaker Pro Advanced
    By genesis in forum Access
    Replies: 1
    Last Post: 08-20-2009, 01:00 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