#1   Report Post  
James
 
Posts: n/a
Default Forms

Hello,

I have a form where one field asks for the persons initials. I would
like any field that the user is in to automatically insert thier
initials and date and then allow them to insert thier own text.

Example:

Field INITIAL: JWA
Fieled COMMENTS: JWA 5/5/05: This is my comment.

In the field COMMENTS once the user is in the field it would
automatically insert their initials and the current date along with a
semicolon.

Thanks in advance!

JA
  #2   Report Post  
Greg Maxey
 
Posts: n/a
Default

James,

You will need a macro set to run on entry to each field following the
Initials field. I created a simple document with two fields bookmarked
Text1 and Text2. Run the macro named FieldID on entry to Text2.

Sub FieldID()
Dim myString As String
myString = ActiveDocument.FormFields("Text1").Result
ActiveDocument.FormFields("Text2").Result = myString & " " _
& Format(Date, "mm/dd/yy") & ": "
Selection.Move Unit:=wdCharacter, Count:=15
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

James" wrote:
Hello,

I have a form where one field asks for the persons initials. I would
like any field that the user is in to automatically insert thier
initials and date and then allow them to insert thier own text.

Example:

Field INITIAL: JWA
Fieled COMMENTS: JWA 5/5/05: This is my comment.

In the field COMMENTS once the user is in the field it would
automatically insert their initials and the current date along with a
semicolon.

Thanks in advance!

JA



  #3   Report Post  
Greg Maxey
 
Posts: n/a
Default

James,

This makes it a little more general. You can run the FiledID macro on all
textform fields after the Initials field.


Sub FieldID()
Dim myString As String
Dim pFldName As String
myString = ActiveDocument.FormFields("Text1").Result
If Selection.FormFields.Count = 1 Then
pFldName = Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count 0 Then
pFldName = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e
End If
ActiveDocument.FormFields(pFldName).Result = myString & " " _
& Format(Date, "mm/dd/yy") & ": "
Selection.Move Unit:=wdCharacter, Count:=15
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

James" wrote:
Hello,

I have a form where one field asks for the persons initials. I would
like any field that the user is in to automatically insert thier
initials and date and then allow them to insert thier own text.

Example:

Field INITIAL: JWA
Fieled COMMENTS: JWA 5/5/05: This is my comment.

In the field COMMENTS once the user is in the field it would
automatically insert their initials and the current date along with a
semicolon.

Thanks in advance!

JA



  #4   Report Post  
James
 
Posts: n/a
Default

Hello Greg,

Thanks for the help!
After I submitted the new form my boss told me that she now wants a
Wizard to generate a dynamic form.

When will this madness end! lol

I appreciate the help!

Thanks again!

James




Greg Maxey wrote:
James,

This makes it a little more general. You can run the FiledID macro on all
textform fields after the Initials field.


Sub FieldID()
Dim myString As String
Dim pFldName As String
myString = ActiveDocument.FormFields("Text1").Result
If Selection.FormFields.Count = 1 Then
pFldName = Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count 0 Then
pFldName = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e
End If
ActiveDocument.FormFields(pFldName).Result = myString & " " _
& Format(Date, "mm/dd/yy") & ": "
Selection.Move Unit:=wdCharacter, Count:=15
End Sub

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
forms gkb New Users 2 April 25th 05 02:30 PM
Disappearing Checkboxes in Forms Jeannette S. Microsoft Word Help 0 February 15th 05 09:25 PM
Advice on forms Pehr Jansson Microsoft Word Help 1 January 25th 05 05:12 AM
Spell check in Forms Mrs Pink Microsoft Word Help 1 January 24th 05 03:41 PM
Forms toolbar won't stay on Gladys Microsoft Word Help 2 January 14th 05 06:23 AM


All times are GMT +1. The time now is 03:23 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"