Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Input mask for form fields in Word
Hi, I was asked to create a new form that has a number of date fields. The boss wants to be able to type 050209 and have it appear as 5/2/09. I know that input masks are available in MS Access, but how do I put something like this in a form field in MS Word? If anybody has any suggestions, I'd really appreciate it. Thanks, Lee -- Lee S. |
#2
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Input mask for form fields in Word
Lee,
You now need to get your boss to change his or her mind. 050209 is not a valid date format. Word sees this as a long value and would return a seemingly odd result. You could show this to your boss: Sub Test() Dim oDate as Date oDate = "050209" Msgbox Format(oDate, "m/d/yy") End Sub AFIAIK (and it would be clunky), all you could do is use a text field to enter the value 050209, then convert it to a valid date format, then format that valid date as the boss desires, then replace the text entered with the formatted date. Lee S. wrote: Hi, I was asked to create a new form that has a number of date fields. The boss wants to be able to type 050209 and have it appear as 5/2/09. I know that input masks are available in MS Access, but how do I put something like this in a form field in MS Word? If anybody has any suggestions, I'd really appreciate it. Thanks, Lee -- Greg Maxey - Word MVP My web site http://gregmaxey.mvps.org Word MVP web site http://word.mvps.org |
#3
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Input mask for form fields in Word
Hi lee,
I believe I've already answered this for you at: http://www.tek-tips.com/viewthread.c...1541593&page=1 If you're going to post the same query in multiple forums, you should say so. - and acknowledge whatever advice you've already received. -- Cheers macropod [MVP - Microsoft Word] PS: A simpler form of the Function I posted at tek-Tips is: Function StrToDate(FFname As String) As String Dim TmpStr TmpStr = ActiveDocument.FormFields(FFname).Result StrToDate = TmpStr If Len(TmpStr) = 6 Then If CDate(Left(TmpStr, 2) & "/" & Mid(TmpStr, 3, 2) & "/" & Right(TmpStr, 2)) Then _ StrToDate = Format(CDate(Left(TmpStr, 2) & "/" & Mid(TmpStr, 3, 2) & "/" & Right(TmpStr, 2)), "DD-MM-YYYY") End If End Function "Lee S." wrote in message ... Hi, I was asked to create a new form that has a number of date fields. The boss wants to be able to type 050209 and have it appear as 5/2/09. I know that input masks are available in MS Access, but how do I put something like this in a form field in MS Word? If anybody has any suggestions, I'd really appreciate it. Thanks, Lee -- Lee S. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
input sequence of form fields | Page Layout | |||
how do i copy form input fields within the same word document? | Tables | |||
Phone# with input mask merged into word | Mailmerge | |||
Form Field Input Mask | Microsoft Word Help | |||
posting data from text input fields to fields later in document | Microsoft Word Help |