Results 1 to 2 of 2
  1. #1
    garciaroizm is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Posts
    15

    Need help to Filter textbox in form

    This is what I have coded, I must be missing something.


    Private Sub Material_Change()
    'If the combo box is cleared, clear the form filter.
    If Nz(Me.Combo300.Text) = "" Then
    Me.Form.Filter = ""
    Me.FilterOn = False
    'If a combo box item is seleccted, filter for an exact match.
    'Use the ListIndex property to check if the value is an item in the list.
    ElseIf Me.Combo300.ListIndex <> -1 Then
    Me.Form.Filter = "[Material] = "" &_"
    Replace(Me.Combo100.Text, "", """) & ""
    Me.FilterOn = True
    'If a partial vaslue is typed, filter for a partial material name match.
    Else
    Me.Form.Filter = "[Material] Like " * " &_ "
    Replace(Me.Combo300.Text, "", "") & "*"
    Me.FilterOn = True


    End If
    'Move the cursor to the end of the combo box.
    Me.Combo300.SetFocus
    Me.Combo300.SelStart = Len(Me.Combo300.Text)


    End Sub

  2. #2
    garciaroizm is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Posts
    15
    It's actually a combo box not textbox

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

Similar Threads

  1. Help with textbox filter please...
    By ajk825 in forum Access
    Replies: 2
    Last Post: 04-25-2014, 06:51 PM
  2. Replies: 2
    Last Post: 01-08-2014, 05:18 PM
  3. Filter and Sort a form based on TextBox Values.
    By Ramun_Flame in forum Programming
    Replies: 7
    Last Post: 10-28-2012, 06:53 AM
  4. Need to Filter Query with textbox
    By jmshipe in forum Access
    Replies: 2
    Last Post: 08-12-2012, 05:46 AM
  5. Replies: 1
    Last Post: 12-04-2011, 06:33 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