Results 1 to 4 of 4

"contains" search

  1. #1
    fishhead is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    43

    "contains" search

    I"m creating an openform macro where the form will open to specific records containing all or part of the string the user provides

    where condition = [Customer Ref #] like Forms![fFindShpt]! *[Combo26] *



    Customer Ref # = the field the form is filtered by
    combo26 = all or part of the string the user provides.

    there is something wrong with my where condition but i don't know what it is.
    Can anyone suggest a better where condition expression?

    thanks

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    19,467
    More like:

    [Customer Ref #] like "*" & Forms![fFindShpt]![Combo26] & "*"

    Not sure about macro syntax since I don't use them. In VBA it would look like:

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

  3. #3
    fishhead is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    43
    works perfectly! thanks Paul

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    19,467
    Happy to help!
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 09-07-2015, 07:00 AM
  2. Replies: 1
    Last Post: 09-03-2014, 02:27 AM
  3. Replies: 5
    Last Post: 12-14-2013, 05:29 AM
  4. Replies: 11
    Last Post: 06-18-2013, 06:48 AM
  5. Replies: 8
    Last Post: 03-05-2013, 12:20 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
  •  
Tech Forums: Microsoft Office Forums