default loading the year on a date form

techexpressinc

Registered User.
Local time
Today, 13:01
Joined
Nov 26, 2008
Messages
185
Is the an way I could default the year on my forms. I tried the attach screen print without success.

Thx
Russ
 

Attachments

  • year default v6-14-10.JPG
    year default v6-14-10.JPG
    56.7 KB · Views: 121
Re: default loading the year on a date form - more info needed

Thank you for the code i need instructions on how to install it. I tried cut pasting it onto the default value line and it failed.

A screen print of it is attached.

Thank you

Russ
 

Attachments

  • default-year-attempt-2 - v06-14-10.JPG
    default-year-attempt-2 - v06-14-10.JPG
    56.2 KB · Views: 125
You need to set the type to text for that field if you want to store just the year in taht field. I would suggest that you leave the field type as a date and use the =Now() function and then use the =Year formula dcrake gave you when you need to display the year.
 
Re: Confused on implementation

Would I put this in the default value somehow for the table field or would this be on the properties of the form field?

" =Now() function and then use the =Year formula "

Russ
 
ahmmmm.... Use that formula on the form property itself and not on the table... I guess there are some values that would not work on a table.
 

Attachments

  • Untitled2.jpg
    Untitled2.jpg
    97.4 KB · Views: 141
Your example did the year alone. How much more difficult would it be to load the month and day.
I would like to see:
00/00/2010 when the user goes to the field so they just enter the month and day and keep going. The set of forms has about dozen dates that will be updated for approx. 1,500 record sets.
Therefore, I am trying to make the form as user friendly as I can.

Thx
Russ
 
Your example did the year alone. How much more difficult would it be to load the month and day.
I would like to see:
00/00/2010 when the user goes to the field so they just enter the month and day and keep going. The set of forms has about dozen dates that will be updated for approx. 1,500 record sets.
Therefore, I am trying to make the form as user friendly as I can.

Thx
Russ

That would require you using an input mask but I think input masks are not user friendly since you have to start keying for the far left of the field and bugs out if the user accidently moves out of place before they start keying. best way to ensure valid dates is to use a date picker. If the date is usually the current date the user is keying then you could set the default value in the form for that field to =Now()
 
i agree with ghudson for the date picker... for the default date, I am not so confident with the now() function as it affects my reporting date especially when I have to pull or make a query dependent on dates... I use Date() for date today... With regards to what you want to accomplish, you did not tell us that thing before... It will be better if you have mentioned it from the start.... if you just type the date and month to a field without input mask but is formatted to mm/dd/yyyy, the default year will still be 2010. No codes needed.
 

Users who are viewing this thread

Back
Top Bottom