Hi there guys.
I have the following code that is called from Afterupdates in several textboxes.
This program is being used in a runtime environment.
My problem is that when somebody searches for a name that has an apostrophe the full version doesn't work and the runtime crashes !
I'm perplexed ?
Is there anything that I can add to my code to get around this?
Or better still understand why it's happening!
I have the following code that is called from Afterupdates in several textboxes.
This program is being used in a runtime environment.
My problem is that when somebody searches for a name that has an apostrophe the full version doesn't work and the runtime crashes !
I'm perplexed ?
Code:
Private Sub subChangeFilter()
If Trim(Me.textBox1 & Me.textBox2 & Me.textBox3 & Me.textBox4 & Me.textBox5 & "") = "" Then
Me.FilterOn = False
Else
Me.Filter = "firstname LIKE '*" & Me.textBox2 & "*' _
AND tp1 LIKE '*" & textBox5 & "*' AND PC LIKE '*" & textBox4 & "*' _
AND surname LIKE '*" & textBox1 & "*' AND A1 LIKE '*" & textBox3 & "*'"
Me.FilterOn = True
End If
End Sub
Is there anything that I can add to my code to get around this?
Or better still understand why it's happening!