Connecting Tech Pros Worldwide Help | Site Map

Set default value to 1/1/current year

Jimmy
Guest
 
Posts: n/a
#1: Dec 22 '06
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?


Rick Brandt
Guest
 
Posts: n/a
#2: Dec 22 '06

re: Set default value to 1/1/current year


Jimmy wrote:
Quote:
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


'69 Camaro
Guest
 
Posts: n/a
#3: Dec 22 '06

re: Set default value to 1/1/current year


Hi, Jimmy.
Quote:
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" <none@none.comwrote in message
news:tUXih.64209$0t1.23236@fe04.news.easynews.com. ..
Quote:
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?
>

Jimmy
Guest
 
Posts: n/a
#4: Dec 22 '06

re: Set default value to 1/1/current year


Thank you, that did the trick.

"Rick Brandt" <rickbrandt2@hotmail.comwrote in message
news:2AYih.34840$wc5.31280@newssvr25.news.prodigy. net...
Quote:
Jimmy wrote:
Quote:
>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
>

Jimmy
Guest
 
Posts: n/a
#5: Dec 22 '06

re: Set default value to 1/1/current year



"'69 Camaro" <ForwardZERO_SPAM.To.69Camaro@Spameater.orgZERO_SP AMwrote in
message news:_JGdnbabis4uxhHYnZ2dnUVZ_ruknZ2d@adelphia.com ...
Quote:
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.
Quote:
>
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" <none@none.comwrote in message
news:tUXih.64209$0t1.23236@fe04.news.easynews.com. ..
Quote:
>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?
>>
>
>

'69 Camaro
Guest
 
Posts: n/a
#6: Dec 23 '06

re: Set default value to 1/1/current year


Hi, Jimmy.
Quote:
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" <none@none.comwrote in message
news:wEZih.86096$Ea5.45486@fe05.news.easynews.com. ..
Quote:
>
"'69 Camaro" <ForwardZERO_SPAM.To.69Camaro@Spameater.orgZERO_SP AMwrote in
message news:_JGdnbabis4uxhHYnZ2dnUVZ_ruknZ2d@adelphia.com ...
Quote:
>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.
>
Quote:
>>
>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" <none@none.comwrote in message
>news:tUXih.64209$0t1.23236@fe04.news.easynews.com ...
Quote:
>>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?
>>>
>>
>>
>
>

Closed Thread


Similar Microsoft Access / VBA bytes