Default Calendar Dates

  • Thread starter Thread starter Lee T.
  • Start date Start date
L

Lee T.

We put up a report screen with two calendars (active x),
one that is the startdate and the other enddate. The
users want us to have the default startdate to be the
first of the prior month and the enddate to be the last
data of the prior month. I have no idea as to where to
begin. I can get it to subtract days but that is all.

Any ideas?

tia

Lee T.
 
To set StartDate and EndDate to cover last month:
Me.StartDate = DateSerial(Year(Date), Month(Date) - 1, 1)
Me.EndDate = DateAdd("m", 1, Me.StartDate) - 1
 
Allen,

Thank you very much. I finally figured it out on my
own but it was a much more complicated solution. (about 3
times as much code as your elegant solution).

Lee T.
 
Back
Top