View Single Post
  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Check boxes and user names in forms

How do you have all of the checkboxes and other formfields arranged?

If they each checkbox and the Name and Time text formfields associated with
it were all in a one row of a table in the order Checkbox, Name formfield,
Time formfield, then you should be able to use the following code on exit
from each of the check boxes

With Selection.Rows(1).Range
If .FormFields(1).CheckBox.Value = True Then
.FormFields(2).result = Application.UserName
.FormFields(3).result = Format(Now, "yyyy-mm-dd -
hh:MM:ss")
Else
.FormFields(2).result = ""
.FormFields(3).result = ""
End If
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"TobyR" wrote in message
...

Indeed, I did post a second time when I thought my first post didn't
work - sorry for the confusion. But to reiterate my last question,
would I have to create a separate macro for each checkbox/text-field
grouping? If so, is there some way to avoid this as I have in mind a
form with about 50 check boxes.

Doug Robbins - Word MVP;460299 Wrote:
See response to your original post.



"TobyR" wrote in message
...-

Moderators please delete - post worked first time round! MS Word 2007
help has a good section on how to create a form with check boxes
(using
legacy controls) but I would like to do something a little more
complex,
namely having fields next to the checkbox which update with the the
username of the person setting the check box and the date the check
box
is set. Is this possible? Any advice or suggestion gratefully
received.




--
TobyR -





--
TobyR