Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.pagelayout
Lee S. Lee S. is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.pagelayout
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default 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   Report Post  
Posted to microsoft.public.word.pagelayout
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
input sequence of form fields Stugi Page Layout 1 July 11th 07 10:15 AM
how do i copy form input fields within the same word document? toolboxx Tables 1 April 23rd 07 02:33 PM
Phone# with input mask merged into word workliveplay Mailmerge 2 October 4th 06 05:39 AM
Form Field Input Mask LeahRose Microsoft Word Help 0 March 14th 05 03:31 PM
posting data from text input fields to fields later in document BOB Microsoft Word Help 1 November 23rd 04 07:19 PM


All times are GMT +1. The time now is 12:06 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"