First day in month

  • Thread starter Thread starter Svein Ludvigsen
  • Start date Start date
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
 
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
 
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]
 
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
 
Back
Top