Results 1 to 4 of 4
  1. #1
    spideynok is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    48

    Sample DB : Search Multiple Data Separated by Comma


    Hi there before I had a problem with multiple search like this, using a keyword and can be separated by comma. Just now I would like to share my code and database for you all and for all the newbie like me that looking for this kind of project. I hope this will help you too.

    NOTE : Search multiple using comma.. DO NOT put space after comma you may search like this : [1,3] and not like this [1, 3].
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Or don't rely on user to not use space and use Trim function to make sure leading spaces, if any, are dropped.
    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
    spideynok is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    48
    Oh sorry sir. I just edited the code after I post this and can use space after comma, so it doesn't make them confuse.

    just change this code :
    Code:
    strFilters = Split(Nz(.Text47, ""), ",")
    into this :
    Code:
    strFilters = Split(Nz(.Text47, ""), ", ")
    NOTE : I just put space on it. Just look at the difference


    BTW this project was made with the help of Sir June7

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    And what if the user does not include space (intentionally or not), the delimiter in the Split won't match. Safer to use only comma as delimiter and Trim function on the array elements.
    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.

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

Similar Threads

  1. Replies: 12
    Last Post: 03-22-2012, 02:48 AM
  2. Replies: 6
    Last Post: 06-26-2011, 12:15 AM
  3. Replies: 2
    Last Post: 04-07-2011, 10:15 AM
  4. Interesting Query Problem (Sample Data Provided)
    By pinecrest515 in forum Queries
    Replies: 1
    Last Post: 02-07-2011, 03:27 PM
  5. Replies: 1
    Last Post: 07-31-2009, 03:57 AM

Tags for this Thread

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