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

I

Irshad Alam

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
 
X

XPS350

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

You can use the DateSerial function:

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

Groeten,

Peter
http://access.xps350.com
 
M

Mike Painter

Irshad said:
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)
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.
 

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