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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Input Mask...need mm/yy

Status
Not open for further replies.

DMG2000

Programmer
Aug 13, 2000
52
0
0
US
I need to get my date input mask so that acceepts "mm/yy" format for a credit card expiration....I have tried using "99/99/00;0;_" for the mask, but when entered 01/02 it appears in the db as 01/02/00.

Thanks!
 
The problem with Access is that if you specifiy a DATE field it wants the date to be the whole date and nothing but the date.
So If your program only asks for 2 parts of a date then guess what the other part is, a default. It's the last day of the month. So they type in 04 in the "Month box" and 03 in the "year box" which is really April of 2003 right.
And in the Table you take and put 04/30/03.
You try using the credit card after 4/30/03 anyway, its May and it won't work.
So how do you get the last day of an unknown month???

LastDay = DateSerial(Val(Yearbox), Val(monthBox) + 1, 1-1)
YourDatefield = DateSerial(Val(Yearbox), Val(monthBox), LastDay)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top