What's wrong with my syntax?

A

Angeline

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.
 
A

Angeline

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
 
D

Douglas J Steele

The Order needs to be in the quotes as well:

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

Angeline

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.
 
Top