Date format in TextBox

H

Haroon

Hi,

I have a date as 01/01/2009 in the textbox on a form and when it is
populated in a bookmark on the document after pressing OK button, i want that
to display as 1 January 2009 not as 01/01/2009, is there a way of doing that?


thanks in advance :)
 
G

Graham Mayor

Is this a Userform or a protected form document?
You can reproduce the content of a form field using a REF field if you check
the calculate on exit check box of the form field, with a few provisos - the
main one being that the REF field is in the body of the document. You can
format a REF field with a switch, so you can reproduce your date form field
with (say ) {REF "Text1" \@ "d MMMM yyyy"}
If inserting the date from a Userform you would need to format the date in
vba as you insert it - see the example at
http://www.gmayor.com/popup_calendar.htm

You would probably find http://gregmaxey.mvps.org/Repeating_Data.htm useful
also.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
H

Haroon

its a userform, when text is entered in the textbox, like 01/01/2009, and
when ok button is pressed, the bookmark gets populated with this date, but i
want it to change to show like this 1 January 2009.

cheers
 
H

Haroon

Solved!

Haroon said:
its a userform, when text is entered in the textbox, like 01/01/2009, and
when ok button is pressed, the bookmark gets populated with this date, but i
want it to change to show like this 1 January 2009.

cheers
 

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