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!

Entering dates in ddmmyy format

Status
Not open for further replies.

jfrizelle

Programmer
Jan 15, 2004
26
0
0
IE
Hi,

I have a number of date fields, and the users of the system want to be able to enter dates without having to enter separators. When I enter dates in that format (150404) I get an error saying "The value you entered isn't valid for that field".

Any way round this?

Thanks
Jennie.
 
hi

you could use an input mask, but personnaly I hate them, alternatively input the value as a string, use isDate() to verify it is a date and CDate() to convert it to a date before saving to your table

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks for that Ken, but the field is not an unbound field being saved to a table - it is a database field. I don't like input masks either so I'd rather stay away from them. I've always used separators myself, so I was never aware of this problem.

I just went into Excel and formatted a cell as a date, and it didn't work there either - an entry of 150404 got converted to 16-Oct-11 - I presume it took my entry to be a Julian number and converted it?

Anyway, thanks again and if anyone knows of any way around this I'd appreciate your help. If there's no way around it, well I guess they'll just have to dry their eyes and get used to it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top