Text Box Formatting

B

Bill

I have a text box where the user enters
text strings of the form mm/dd, but the
table field IS NOT a date per se'. What
would be the formatting specifications
for the text box so that when the user
enters something like 6/1 the format
will be changed automatically to 06/01?
I tried ##/##, but it gets changed to
#\/# and the string remains without the
leading zeros.

Thanks,
Bill
 
D

Douglas J. Steele

You may have to get create and break the text down to its component parts:

Format(CInt(Left(MyTextField, InStr(MyTextField, "/") - 1)), "00") & "/" & _
Format(CInt(Mid(MyTextField, InStr(MyTextField, "/") + 1)), "00")
 
B

Bill

Thanks Doug.

Douglas J. Steele said:
You may have to get create and break the text down to its component parts:

Format(CInt(Left(MyTextField, InStr(MyTextField, "/") - 1)), "00") & "/" &
_
Format(CInt(Mid(MyTextField, InStr(MyTextField, "/") + 1)), "00")
 

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