Results 1 to 9 of 9
  1. #1
    ericfatherree is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2012
    Location
    Arkansas
    Posts
    9

    Query several Columns in same Table

    I Have created a simple database to keep up with company contacts. and created a query using ("Like "*" & [enter name or any part of] & "*") in the criteria field. My question is how can I search Multi Columns in the same table instead of it just searching one place. Example type in "Joe or Fire Dept" and it pull up the files I need. I also created a form with the Query so that it pulls all results into one page and it is looking good. Just can not get the search to search my whole table, it just searches "name" or "phone" or Company which ever i place the query coding into.



    Do not really need any advance coding, just something that I can leave up and have other co-workers search the contacts, most of the co-works have no knowledge of access so do not know how to change around locations from tables to forms and ect.


    Any help would be great.

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    This will be helpful and easy to set up and give you flexibility for your users.

    http://www.datapigtechnologies.com/f...earchform.html

    Alan

  3. #3
    ericfatherree is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2012
    Location
    Arkansas
    Posts
    9
    That works well for searching boxes but you have to enter all search info in different search boxes. That example gives five different fields. I would like one search box that will search all five columns at same time.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Don't do search in a query, use a form. Using a query would require input parameter prompt under each column. With a form, user can choose which fields to input criteria for.

    Check out these tutorials
    http://datapigtechnologies.com/flash...earchform.html
    http://datapigtechnologies.com/flash...tomfilter.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.

  5. #5
    ericfatherree is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2012
    Location
    Arkansas
    Posts
    9
    All of these options are allowing to still only search a specific field for each text box. Example you want a phone number search you have to enter it into the phone number box, if you want a address you have to enter it into address box, I want one box that will allow users to search any field within that table with only "one search box"

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Try this. Put the same input parameter under each column, each on a different Criteria row so that the OR logical operator is used. Now enter 542 as search criteria. All records with 542 in any field (phone number, address, SSN, credit score, etc.) will be retrieved.

    Is that what you want?
    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
    ericfatherree is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2012
    Location
    Arkansas
    Posts
    9
    Quote Originally Posted by June7 View Post
    Try this. Put the same input parameter under each column, each on a different Criteria row so that the OR logical operator is used. Now enter 542 as search criteria. All records with 542 in any field (phone number, address, SSN, credit score, etc.) will be retrieved.

    Is that what you want?
    Yes, that is what I am needing. can you give me steps to do that. Im not sure if I follow you on "Put the same input parameter under each column, each on a different Criteria row so that the OR logical operator is used"

    Can you explain little more please.

    Thanks In Advance

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Criteria can use AND and OR logical operators. If parameters are all on the same Criteria row, AND will apply. Put parameter under each column on a separate Criteria row in the query design grid (will look like stair steps). The grid shows a row called Criteria and below that 'or'. Keep entering or rows below that. Use your original parameter:
    ("Like "*" & [enter name or any part of] & "*"). Can't make it any simpler.

    Access Help has guidelines on using the query designer.
    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.

  9. #9
    ericfatherree is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2012
    Location
    Arkansas
    Posts
    9
    That is what I needed, it worked GREAT. I had been copying the command accross in same line and like you said it was looking for it wrong. Now it is working great. Thank you so much.

    Eric

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

Similar Threads

  1. Filter a table's columns
    By e.badin in forum Programming
    Replies: 3
    Last Post: 04-20-2011, 09:53 AM
  2. Me not picking up new columns in table
    By asterismw in forum Programming
    Replies: 3
    Last Post: 03-11-2011, 02:00 PM
  3. Table with look-up columns
    By Tallica in forum Database Design
    Replies: 3
    Last Post: 03-02-2010, 02:09 PM
  4. Replies: 3
    Last Post: 01-21-2010, 08:10 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