Format Date to Month/Year--stumper!

K

kevinhay

Hey, guys:

What I need is to take what the user enters into a date field an
convert it to month/year format, essentially, mmmm/yyyy. What I'
having problems with is the fact that the user is required just t
enter a month/year, either month name or month number and year. Wit
this comes the problem that if the user enters 3/03 for March 2003
Access converts this to the "behind-the-scenes" date serial number an
THEN to the mmmm/yyyy format. You guessed it. It turns it int
March/2004 because it interprets 3/03 as March 3 and tacks on th
current year, in this case 2004.

If you enter the month name/number and the FOUR-digit year, it doe
what I need it to do. So, I've used the input-mask: Aaa"/20"00;0;" "
This forces at LEAST one letter or digit in the first spot or up t
three letters if they want to use the 3-letter abbreviation of th
month. This works great. . .for ENTERING data. When I try to EDI
records based on this input mask, for example backspacing the 4 an
putting a 3 in March/2004, it gives me the error saying that it doe
not fit the input mask. Essentially, I'd have to have the contro
completely erased so the input mask would work effectively. That'
counter-productive. WHY it gives this error, I do not know. I'm sure i
has a perfectly [obscure] legitimate reason. But, do you see m
dilemma? Suggestions would be greatly welcomed
 

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