Default Date

G

Grant

I have a form where I want a textbox to have the default
date of the January 1, of the current year, and I have
another textbox where I want the default of the last day
of the current month in current year. I feel that I tried
everything only b/c the textbox is formated to Short Date.
Does anyone have any solutions?
Thanks in advance for your kindness.
 
F

fredg

Grant said:
I have a form where I want a textbox to have the default
date of the January 1, of the current year, and I have
another textbox where I want the default of the last day
of the current month in current year. I feel that I tried
everything only b/c the textbox is formated to Short Date.
Does anyone have any solutions?
Thanks in advance for your kindness.

In the Control's Default property:

For the first day of the year...
=DateSerial(Year(Date()),1,1)

For the last day of the current month:
=DateSerial(Year(Date()),Month(Date())+1,0)

The Formatting of the date is irrelevent.
 
G

Guest

Hey Fred,
You the man, Thanks for your help.
-----Original Message-----


In the Control's Default property:

For the first day of the year...
=DateSerial(Year(Date()),1,1)

For the last day of the current month:
=DateSerial(Year(Date()),Month(Date())+1,0)

The Formatting of the date is irrelevent.
--
Fred
Please reply only to this newsgroup.
I do not respond to personal e-mail.
.
 

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