Jim Stanicki
Registered User.
- Local time
- Today, 02:33
- Joined
- Aug 7, 2007
- Messages
- 36
I am not yet comfortable with date compares. Would someone please tell me how this should be done? I present a form asking for start and end date and want to restrict report data to that date range.
Thanks
Jim
Private Sub Report_Open(Cancel As Integer)
Dim dteStart As Date
Dim dteEnd As Date
DoCmd.OpenForm "AskDates", windowMode:=acDialog
dteStart = Forms("AskDates")!txtStartDate
dteEnd = Forms("AskDates")!txtEndDate
Me.RecordSource = "SELECT * FROM traffic where Date >= " & dteStart & "; "
End Sub
Thanks
Jim
Private Sub Report_Open(Cancel As Integer)
Dim dteStart As Date
Dim dteEnd As Date
DoCmd.OpenForm "AskDates", windowMode:=acDialog
dteStart = Forms("AskDates")!txtStartDate
dteEnd = Forms("AskDates")!txtEndDate
Me.RecordSource = "SELECT * FROM traffic where Date >= " & dteStart & "; "
End Sub