Passing Date from a form to SQL Select

L

Little Penny

I'm having problem passing dates from a from in to my query so I can
load a recorset in a another form. I"m getting runtime error 2001.



GCriteria = "[JobName] Like """ &
Forms![frmSearchByJobandDate]![txtSearchString] & "*" & _
""" AND [JobDate] >= """ &
Forms![frmSearchByJobandDate]![CboBeginningDate] & "*" & _
""" AND [JobDate] <= """ &
Forms![frmSearchByJobandDate]![CboEndingDate] & "*" & """"


Form_frm_LogJobDataView.RecordSource = "select * from tbl_JobData
where " & GCriteria

I'm sure my syntax is very bad but I can't figure it out.



Any help would be greatly appreciated,


Thanks



Little Penny
 
T

Tom van Stiphout

On Fri, 15 Jan 2010 19:53:33 -0500, Little Penny

Dates need to be wrapped by #-signs, assuming your back-end is Access.

-Tom.
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top