Record Source Syntax Problem

papic1972

Registered User.
Local time
Tomorrow, 08:11
Joined
Apr 14, 2004
Messages
122
Hi all,

I have the following code on a command button:

Me.subfrmAdbriMasonry.Form.RecordSource = "SELECT * FROM qryContractAdbriMasonry WHERE qryContractAdbriMasonry.Plant Like "MOOR" AND qryContractAdbriMasonry.DeliveryDate BETWEEN #" & Format(Forms![frmCandM]![txtStartDate], "mm/dd/yyyy") & "# And #" & Format(Forms![frmCandM]![txtEndDate], "mm/dd/yyyy") & "#"


Basically I'm trying to filter records on a subfrm to show records where the 'Plant' field equals "MOOR" between a particular date range. I can't see where i'm going wrong with my code, but Access keeps telling me that i have a compile error. Can anyone point out the obvious to me??
Thanks.
 
Change the double quotes around MOOR to single quotes. They are terminating the string.
 
Of course!! Stupid error!
Thank you so much pbaldy!!
 

Users who are viewing this thread

Back
Top Bottom