By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 3,094 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Set default value to 1/1/current year

P: n/a
How do I set the default value of a text box (date/time) to 1/1/Current
Year... i.e 1/1/2006 this year, 1/1/2007 next year?
Dec 22 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Jimmy wrote:
How do I set the default value of a text box (date/time) to
1/1/Current Year... i.e 1/1/2006 this year, 1/1/2007 next year?
=DateSerial(Year(Date()), 1, 1)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Dec 22 '06 #2

P: n/a
Hi, Jimmy.
How do I set the default value of a text box (date/time) to 1/1/Current
Year... i.e 1/1/2006 this year, 1/1/2007 next year?
Set the text box's Default Value Property:

="1/1/" & Year(Date())

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Jimmy" <no**@none.comwrote in message
news:tU*******************@fe04.news.easynews.com. ..
How do I set the default value of a text box (date/time) to 1/1/Current
Year... i.e 1/1/2006 this year, 1/1/2007 next year?

Dec 22 '06 #3

P: n/a
Thank you, that did the trick.

"Rick Brandt" <ri*********@hotmail.comwrote in message
news:2A*******************@newssvr25.news.prodigy. net...
Jimmy wrote:
>How do I set the default value of a text box (date/time) to
1/1/Current Year... i.e 1/1/2006 this year, 1/1/2007 next year?

=DateSerial(Year(Date()), 1, 1)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Dec 22 '06 #4

P: n/a

"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AMwrote in
message news:_J******************************@adelphia.com ...
Hi, Jimmy.

Set the text box's Default Value Property:

="1/1/" & Year(Date())
No can do. I tried this and the default value in the text box shows up as
1/1/2006 but access doesn't seem to recognize it as a valid date.

I used another suggestion...

=DateSerial(Year(Date()), 1, 1)

--
Rick Brandt, Microsoft Access MVP

which works great.
>
HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Jimmy" <no**@none.comwrote in message
news:tU*******************@fe04.news.easynews.com. ..
>How do I set the default value of a text box (date/time) to 1/1/Current
Year... i.e 1/1/2006 this year, 1/1/2007 next year?


Dec 22 '06 #5

P: n/a
Hi, Jimmy.
access doesn't seem to recognize it as a valid date.
It works in the U.S. version of Access 2003, with both bound and unbound text
boxes, with both Date/Time and Text data types. Dates can be formatted
differently, depending upon the locality, but whether 1/1/2006 means January 1,
2006 or 1 January 2006 due to your settings, I can't think of why Access would
complain. Is it not a Jet table that this text box is bound to?

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Jimmy" <no**@none.comwrote in message
news:wE*******************@fe05.news.easynews.com. ..
>
"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AMwrote in
message news:_J******************************@adelphia.com ...
>Hi, Jimmy.

Set the text box's Default Value Property:

="1/1/" & Year(Date())

No can do. I tried this and the default value in the text box shows up as
1/1/2006 but access doesn't seem to recognize it as a valid date.

I used another suggestion...

=DateSerial(Year(Date()), 1, 1)

--
Rick Brandt, Microsoft Access MVP

which works great.
>>
HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Jimmy" <no**@none.comwrote in message
news:tU*******************@fe04.news.easynews.com ...
>>How do I set the default value of a text box (date/time) to 1/1/Current
Year... i.e 1/1/2006 this year, 1/1/2007 next year?



Dec 23 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.