Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Text is the wrong property. Value is correct property. It is also the default for data controls and need not be typed.

    Doesn't work because you haven't parsed the string into individual word components and concatenated to criteria string. Requires an array and looping structure. Something like:

    Dim aryWords As Variant, i As Integer, strFilter As String
    aryWords = Split(Me.wpssearch, " ")
    For i = 0 to UBound(aryWords)
    strFilter = strFilter & "Description LIKE ""*" & aryWords(i) & "*"" OR "
    Next
    strFilter = Left(strFilter, Len(strFilter) - 4))
    Me.Filter = strFilter
    Me.FilterOn = True
    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.

  2. #17
    revvedmoto is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    32
    Great!! That fixed that. Again thanks for all the help June.

    Here's the code for anyone else that runs into the same issue

    Private Sub wpssearch_AfterUpdate()
    Dim aryWords As Variant, i As Integer, strFilter As String
    aryWords = Split(Me.wpssearch, " ")
    For i = 0 To UBound(aryWords)
    strFilter = strFilter & "Description LIKE ""*" & aryWords(i) & "*"" AND "
    Next
    strFilter = Left(strFilter, Len(strFilter) - 4)
    Me.[wps subform].Form.Filter = strFilter
    Me.[wps subform].Form.FilterOn = True
    End Sub

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Return the result of a search
    By Loc in forum Programming
    Replies: 11
    Last Post: 06-12-2013, 06:23 PM
  2. Highlight key search result
    By uronmapu in forum Access
    Replies: 28
    Last Post: 06-17-2012, 09:32 AM
  3. Replies: 1
    Last Post: 06-09-2012, 05:44 PM
  4. Replies: 1
    Last Post: 12-20-2011, 03:32 PM
  5. Replies: 3
    Last Post: 06-04-2011, 12:23 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