Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find recordset using date field problem

Status
Not open for further replies.

millrat

Technical User
Dec 23, 2003
98
US
Hi all,
I am trying to find a record on my form using the code below but I keep getting errors. Depending on how I move the quotes etc around I get different errors, sometimes data type mismatch, other times syntax error, missing operator. Now I'm confused, is it the syntax or the datatype?

[dtmDate] is the field datatype Date
Me.cboDate is textbox control source [dtmDate]

Dim rst As DAO.Recordset
Set rst = Forms!frmLog.Recordset.Clone
rst.FindFirst "[dtmDate]= '" & Me.cboDate & "'"
If Not rst.EOF Then
Forms!frmLog.Bookmark = rst.Bookmark
End If
End If

Any help appreciated
millrat
 
Hi
Dates need #.
[tt] rst.FindFirst "[dtmDate]= #" & Me.cboDate & "#"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top