How to find Records by date in Forum

K

kashif

i am using to find records in forms with this codes.if i want to fin
the records by date .i mean my field type is date.how can i find
any body can help me.Thanks
Private Sub cboSelect_AfterUpdate()

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[autonumber] = " & Chr$(39) & _
Me![cboselect] & Chr$(39)

If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Su
 
J

John Vinson

i am using to find records in forms with this codes.if i want to find
the records by date .i mean my field type is date.how can i find
any body can help me.Thanks
Private Sub cboSelect_AfterUpdate()

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[autonumber] = " & Chr$(39) & _
Me![cboselect] & Chr$(39)

If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub

If the field your searching is named [datefield] rather than
[autonumber], change the FindFirst line to

rs.FindFirst "[datefield] = #" & Me!cboSelect & "#"
 

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

Similar Threads

Textbox Filter 4
Search combo box 2
Direct jump to a record 1
Searching 3
Error 2147352567 2
Copy Record Button Function 1
RunTime Error 3070 11
OnLoad event criteria 7

Top