Auto Generate The First And Last Date Of This Month

on-2

Registered User.
Local time
Today, 17:51
Joined
Nov 24, 2002
Messages
34
Does anyone know how to write a simple method of having a text box on a form default to the first day of the current month. i.e. 01/05/2005 and then a second one equalling the last day of the current month i.e. 31/05/2005?

I can make it simply default to today by having the obvious =now() or =date() in the default section but i am bit stumped.

Any help would be greatly appreciated
Cheers
Alex
 
First day of month:
Code:
=DateSerial(Year(Date()), Month(Date()), 1)
Last day of month:
Code:
=DateAdd("m", 1, DateSerial(Year(Date()), Month(Date()), 1)) - 1
 
works perfectly

thank you very much works perfectly
 

Users who are viewing this thread

Back
Top Bottom