This will output the date values to the debug window, but
you can send them to a form, report, or table as well:
Public Function DateLoop()
Dim dtmStartDate As Date
Dim dtmEndDate As Date
Dim dtmCalcDate As Date
dtmStartDate = "12/10/2003"
dtmEndDate = "1/15/2004"
dtmCalcDate = dtmStartDate
Do
dtmCalcDate = DateAdd("d", 1, dtmCalcDate)
If dtmCalcDate = dtmEndDate Then
Exit Do
End If
Debug.Print dtmCalcDate
Loop
End Function
You can get more help on the DateAdd() function in online help.
|