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