Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Formats & Input Masks: Non-Programmer Needs Help

Status
Not open for further replies.

JerSand

Technical User
Oct 25, 2000
74
US
I have given the date fields in a table a Short Date format and a Short Date input mask. I'm using ACCESS 2000. I'd like to enable the user to enter only six digits--mm/dd/yy--and have the instrument translate the year into four digits. However, my tests using the associated form have yielded only error messages indicating that such an entry is invalid. I've tried editing the input mask, but have been unsuccessful. I've been unable to obtain a fix from the Help facility and the books I have on hand, and I'd be grateful if a Forum member would give me the answer.

Thanks.

JerSand
 
What error are you getting? What's the "insturment" and why do you need to translate?

Post more details and I can help you.
Mike
 
Thanks for responding, Mike.

By the "instrument," I simply meant ACCESS 2000.

The month/day/year separators show-up fine, but ACCESS is insisting that I enter all four numbers in the year part of a date field. For instance, if I'm trying to enter March 3, 1996 and type the numbers "030496", I receive this error message: "The value you entered isn't appropriate for the input mask '99/99/0000'0'_' specified for this field." The form will accept only "03041996".

I get this message whether or not I specify an input mask (that is, when I instead simply specify "Short Date" on the format line.)

The form has a multitude of dates the user will have to enter, and over the course of many entries, being able to enter just the last two digits of the year would add-up to a considerable amount of time savings.

When I spoke of "translation," I was simply assuming that ACCESS would impute and enter the first two digits, and I assumed that would be necessary in order to do date computations.

It may be, I suppose, that I'm asking ACCESS 2000 to do something it won't do. I thought it likely, however, that I instead haven't given it the right instruction.

Thanks again for your reply, Mike.

Jerry
 
Try this:
Make the Format mm/dd/yy

and the Input Mask ##/##/##

Let me know if this helps.
 
A neat idea -- but it's a feisty pair of properties, it seems. Against any logic apparent to me, it gave me the exact same error message. Thanks for your suggestion.
 
I believe that you may be coming up against the Regional properties in:
Start Button|Settings|Control Panel|Regional Settings|Date

What version of Windows are you on?

I am on Win98 (not SE)
if I go into my Regional Properties it has:
Gregorian Calendar at the top as the Calendar type

Below that is :

When a two digit year is entered, interpret as a Year in between: 1930 and then a Combo box with (on mine) 2029

Does that help?
Regards Jim
 
Thanks for the idea, Jim. Your mail gave me the "Eureka" feeling. I first tried a few combinations of settings and input masks and then, having not hit on the right combination, checked ACCESS help. Microsoft confirms your diagnosis of the problem. Still, I haven't found a setting that works, but I'll keep trying. I'm grateful for your suggestion.

Jerry
 
I may have find a simple solution to your problem.
I just gave the following a try and I think it does what you want it to do:

Set the Input mask to: 00/00/00## and the format to long date (Note this will show 10 february 2002)

When inputting the date only 4 digits need to be entered the last two can be missed out by pressing TAB or ENTER and ACCESS will convert your input to Long Date Format so you will get your four digit year.

Hope this helps, if not, hope you solve the problem.

J. Ahmed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top