First day in month

S

Svein Ludvigsen

I want to set my Calendercontrolls like this in Form-Load:

Calendercontrolla.Value = "first day of current month"
Calendercontrollb.Value = "last day of current month"

How can i do this?

Svein
 
C

Chris Reveille

Here is a previous response by John Vinson
The first day of the current month.
DateSerial(Year(Date()), Month(Date()), 1)
The first day of the current month one year ago.
DateSerial(Year(Date())-1, Month(Date()), 1)
The last day of the current month one year ago.
DateSerial(Year(Date())-1, Month(Date())+1, 0)
The first day of the current year.
DateSerial(Year(Date()), 1, 1)

Jim
 
J

John Vinson

I want to set my Calendercontrolls like this in Form-Load:

Calendercontrolla.Value = "first day of current month"
Calendercontrollb.Value = "last day of current month"

How can i do this?

Svein

DateSerial(Year(Date()), Month(Date()), 1)

and

DateSerial(Year(Date()), Month(Date()) + 1, 0)

respectively.

John W. Vinson[MVP]
 
S

Svein Ludvigsen

John Vinson said:
DateSerial(Year(Date()), Month(Date()), 1)

and

DateSerial(Year(Date()), Month(Date()) + 1, 0)

respectively.

John W. Vinson[MVP]


Thanks guys..

Svein
 
Top