S
skydiver
I am having a problem with the syntax for the following code.
'''If specified a Work Area
If Not IsNothing(Me.cboWorkArea) Then
varWhere = (varWhere + " AND ") & "[WorkArea] LIKE '*" &
Me.cboWorkArea & "*'"
End If
'''If specified a Location
If Not IsNothing(Me.cboLocation) Then
varWhere = (varWhere + " AND ") & "[Location] LIKE '*" &
Me.cboLocation & "*'"
End If
Each varwhere get their values from a combo box. The codes actually works
fine as long as neither of the two fields have a value with an apostrophe
i.e., Warden's. The search works fine when the apostrophe is removed.
Could someone help me with this please?
Thanks in advance.
'''If specified a Work Area
If Not IsNothing(Me.cboWorkArea) Then
varWhere = (varWhere + " AND ") & "[WorkArea] LIKE '*" &
Me.cboWorkArea & "*'"
End If
'''If specified a Location
If Not IsNothing(Me.cboLocation) Then
varWhere = (varWhere + " AND ") & "[Location] LIKE '*" &
Me.cboLocation & "*'"
End If
Each varwhere get their values from a combo box. The codes actually works
fine as long as neither of the two fields have a value with an apostrophe
i.e., Warden's. The search works fine when the apostrophe is removed.
Could someone help me with this please?
Thanks in advance.