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 & "#"
 
Back
Top