Jump to content
Microsoft Windows Bulletin Board

Recommended Posts

Posted

 

Hello Experts, 

I am having a tough time adding a condition to a filter on a form. 

It works with 1 condition but not sure about the OR part (sq, dq)

Maybe it is correct.

The error I get is "Type Mismatch" see pic below.

The row highlighted is the Remarks line. 

It seems odd because the fields are "short text" in the underlying table. 

Do you see an issue with the OR statement?  

If not, any ideas why I would be getting that error knowing that the fields are text?  

Private Sub txtEndUser_AfterUpdate()

       'http://allenbrowne.com/ser-28.html
    
      If IsNull(Me.txtEndUser) Then
        Me.FilterOn = False
      Else

        Me.Filter = "[Remarks 1] Like '*" & [txtEndUser] & "*'" Or "[Remarks 2] Like '*" & [txtEndUser] & "*'"
        Me.FilterOn = True
      End If
      
End Sub

here is the table showing they are short text. 

the table is imported. 

as a reminder, I have no issues with 1 condition meaning it filters fine. 

 

View the full article

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...