Hello,
I have a parameter form for a report. In it, I have a field for a start date (StartD) and an end date (EndD). I would like the fields' default values to be the earliest and latest date (StartDate) in my table (tblStudents).
I found this code in an Access 2000 book, but it isn't doing anything when I open the form:
Private Sub Form_Load()
Dim DateRange As New Recordset
DateRange.Open _
"SELECT Min(DateValue(StartDate)) as SDate," & _
"Max(DateValue(StartDate)) as EDate " & _
"FROM tblStudents", _
CurrentProject.Connection
Me.StartD = DateRange!Sdate
Me.EndD = DateRange!Edate
End Sub
Can anybody tell me why it doesn't work?
Thanks,
Al