How to find Records by date in Forum

  • Thread starter Thread starter kashif
  • Start date Start date
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
 
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


Back
Top