VBA code to call first date of the year and last date of the year

VBA code to call first date of the year and last date of the year

Post by SXJzaGFkIE » Fri, 16 Apr 2010 18:41:02


I have a command button and 2 text field :

On click event I need Text1 to get the first date of the current year (like
01-01-2010) and Text2 to get end date of the current year (like 31-12-2010)

Please advice

Regards

Irshad
 
 
 

VBA code to call first date of the year and last date of the year

Post by XPS35 » Fri, 16 Apr 2010 19:36:18

On Apr 15, 11:41m, Irshad Alam


You can use the DateSerial function:

DateSerial (Year(Date(),1,1) and DateSerial (Year(Date(),12,31)

Groeten,

Peter
http://www.yqcomputer.com/

 
 
 

VBA code to call first date of the year and last date of the year

Post by Mike Paint » Sat, 17 Apr 2010 05:01:05


Text1 = #01 01#
text2 = #31 12#
should work.
Access defaults to the current year if it in not specified.

If they have to do it all the time set the defaults to the above and get rid
of the button.