Default Calendar Dates

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.
 
A

Allen Browne

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
 
L

Lee T.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top