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

Change date input mask? 1

Status
Not open for further replies.

HenryAnthony

Technical User
Feb 14, 2001
358
US
Hi,

This just seems silly.

I have a table with a date field that has this input mask: 99/99/00;0;_
It formats the date as such: 11/03/04

I want to change the slashes to "-" because I use the date to generate a folder using the date as part of the folder name and slashes are not allowed. So I try this input mask: 99\-99\-00;0;_

When I enter a date, the dashes show but when I exit the field they change back to slashes. Can I not change these slashes in a date field?

I realize I could make this text but I may be doing some calculations on date.

Thanks,

Henry
 
can't you try the edit list to suit your requirments when you go into the input mask

Hope this helps
Hymn
 
Hymn,

I have found through help on input mask that date separators are determined by the regional settings in the control panel and cannot be changed using the input mask. I am searching threads and coming up with some ideas but nothing that works yet. I will post if I find a solution.

Thanks

Henry
 
I use the date to generate a folder
Use the Format function:
Format([date field], "yyyy-mm-dd")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

I was going to post this and ask if it could be improved on but you beat me to it. Oh well, I got it to work and it was a good learning exercise. Here is my expression. Hope you have a good laugh like me :DDDDDDDDDDDD

=IIf(DatePart("m",[Form2].[Form]![revdate])<10,"0" & DatePart("m",[Form2].[Form]![revdate]),DatePart("m",[Form2].[Form]![revdate])) & "-" & IIf(DatePart("d",[Form2].[Form]![revdate])<10,"0" & DatePart("d",[Form2].[Form]![revdate]),DatePart("d",[Form2].[Form]![revdate])) & "-" & DatePart("yyyy",[Form2].[Form]![revdate])

Here is your improvement:

=Format([Form2].[Form]![revdate],"yyyy-mm-dd")

Thanks - I award you a star,

Henry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top