What's wrong with my syntax?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get "Type Mismatch" and I'm sure it's something to do with all those
quotes! Can someone help me out please? Many thanks!

This code resides in an On Click Event Procedure:

"[VendorPart] LIKE '*" & Me![VP] & "*'" Or "[Desc] LIKE '*" & Me![VP] & "*'"

The Or operator does appear in blue, but when you work with the form you get
a Type Mismatch when you click the button.
 
Sorry...here is the entire event code:
--------------------------------------------------------------------
Dim strRecord As String
Set rst = Me.RecordsetClone
strRecord = "[VendorPart] LIKE '*" & Me![VP] & "*'" Or "[Desc] LIKE '*" &
Me![VP] & "*'"
rst.FindNext strRecord
Me.Bookmark = rst.Bookmark
 
The Order needs to be in the quotes as well:

"[VendorPart] LIKE '*" & Me![VP] & "*' Or [Desc] LIKE '*" & Me![VP] & "*'"
 
That did it...thanks much!

Douglas J Steele said:
The Order needs to be in the quotes as well:

"[VendorPart] LIKE '*" & Me![VP] & "*' Or [Desc] LIKE '*" & Me![VP] & "*'"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Angeline said:
I get "Type Mismatch" and I'm sure it's something to do with all those
quotes! Can someone help me out please? Many thanks!

This code resides in an On Click Event Procedure:

"[VendorPart] LIKE '*" & Me![VP] & "*'" Or "[Desc] LIKE '*" & Me![VP] & "*'"

The Or operator does appear in blue, but when you work with the form you get
a Type Mismatch when you click the button.
 
Back
Top