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

Formatting date in TextBox doesn't stick

Status
Not open for further replies.

GoKingBee

Technical User
Mar 5, 2004
10
CA
I am populating a TextBox with a date. The TextBox is linked to a field on my spreadsheet. I use the code as follows:

FormName.DateTextBox.Value = format(now(),"dd-mmm-yyyy")

The problem is, as soon as I leave the TextBox the date format reverts to "mm/dd/yy". Is there a way to have the format remain unchanged?
thx
Bill
 
The TextBox is linked to a field on my spreadsheet
What is the format of this cell ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
The format of the spreadsheet cell is:

dd-MMM-YY

It doesn't seem to matter what format the cell is - the userform textbox still changes to mm/dd/yy

Bill
 
Have you tried to change the cell format to text ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Well Well - your idea worked. The only thing I need to do now is write some additional code to rewrite the text formatted date to a date formatted date.
thx
Bill King
 
Take a look at the CDate function.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top