Results 1 to 4 of 4
  1. #1
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276

    Search Filter Criteria Help

    I am using the following Search filter criteria



    Like "*" & [Forms]![PriceListForm].[TxtPrc] Or Like [Forms]![PriceListForm].[TxtPrc] & "*"



    When I enter word "Broken" in the text box "TxtPrc" I get the following result
    Broken Glass Green
    Broken Glass Mix
    Broken Glass White

    for word "Green" in the text box "TxtPrc" I get the following result
    Broken Glass Green

    for word "Mix" in the text box "TxtPrc" I get the following result
    Broken Glass Mix

    for word "White" in the text box "TxtPrc" I get the following result
    Broken Glass White


    But if I type Glass the result is empty.

    How can I fix this If I type "Glass" I should get the result wherever word "Green" is, It should be displayed.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    The values with Glass in the middle meet neither of the parameters (either at the end or the beginning)

    Try this instead:

    Like "*" & [Forms]![PriceListForm].[TxtPrc] & "*"
    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
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Like "*" & [Forms]![PriceListForm].[TxtPrc]
    This part finds all occurances where "TxtPrc" is at the end of the data in the field

    Or Like [Forms]![PriceListForm].[TxtPrc] & "*"
    This part finds all occurances where "TxtPrc" is at the beginning of the data in the field

    Maybe try:

    Code:
    Like "*" & [Forms]![PriceListForm].[TxtPrc] & "*"

  4. #4
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    thx worked like a charm

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

Similar Threads

  1. Replies: 7
    Last Post: 09-27-2014, 09:11 PM
  2. Replies: 2
    Last Post: 09-24-2013, 07:54 PM
  3. Better search and filter VBA
    By Dazza666 in forum Programming
    Replies: 7
    Last Post: 07-17-2013, 11:33 AM
  4. Replies: 1
    Last Post: 01-30-2012, 12:12 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