I have the following code in the on open event of my form:
Private Sub Report_Open(Cancel As Integer)
Dim sDate As Date, eDate As Date
sDate = Format(Form_frmDatePicker.ActiveXCtl1, "Short Date"
eDate = Format(Form_frmDatePicker.ActiveXCtl3, "Short Date"
Me.RecordSource = "SELECT * FROM qryDNA WHERE ([Course Date] >= #" _
& sDate & "# And [Course Date] <= #" & eDate & "#)"
End Sub
For some reason, the record doesn't produce the correct results. For test purposes, I have a table with six records in it, all containing different dates in one field. I pick two dates where only 3 of these records should be displayed yet 5 records are shown.
It would make more sense if all 6 were shown but they're not.
Anyone know whats up?
Cheers,
Pete
Private Sub Report_Open(Cancel As Integer)
Dim sDate As Date, eDate As Date
sDate = Format(Form_frmDatePicker.ActiveXCtl1, "Short Date"
eDate = Format(Form_frmDatePicker.ActiveXCtl3, "Short Date"
Me.RecordSource = "SELECT * FROM qryDNA WHERE ([Course Date] >= #" _
& sDate & "# And [Course Date] <= #" & eDate & "#)"
End Sub
For some reason, the record doesn't produce the correct results. For test purposes, I have a table with six records in it, all containing different dates in one field. I pick two dates where only 3 of these records should be displayed yet 5 records are shown.
It would make more sense if all 6 were shown but they're not.
Anyone know whats up?
Cheers,
Pete