Form Fields/Check Boxes

M

Mmay

I am creating a word 2002 form to be used online as a fill-in application for
employment. I have written the macro below to use on exit for a form field
but would prefer it to work upon editing of the text such as checking yes in
a check box or entering name, address, etc. in a text box. Also, is there a
way to have the field shading removed upon entry of a form field so that
users will know where they are in the form?
I apply this macro in the form field properties to run on entry currently.
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 3/14/2008 by mmay
'
ActiveDocument.Unprotect Password:=""
Selection.Font.Color = wdColorAutomatic
ActiveDocument.Protect Password:="", NoReset:=True, Type:= _
wdAllowOnlyFormFields
End Sub
 
G

Graham Mayor

What it is that you think your macro is supposed to do?
It doesn't seem to do anything useful that cannot be achieved by formatting
the document.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

Mmay

When a user enters the form online it is protected, this macro automatically
changes the color of the text box font once they exit the field (to help them
keep track of which fields they have answered). I would like my macro to
change the color of the font, only if they edit the information in the text
box and for the background shading to disappear as the field is exited.
This would allow them to track their progress on the form but also make it
easier once it is printed at our company, for the personnel department to
differentiate their responses from the questions.
 
T

Tony Strazzeri

What it is that you think your macro is supposed to do?
It doesn't seem to do anything useful that cannot be achieved by formatting
the document.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

I assume you mean Changing the value. If this is the case you need to
store the original value of the field/item and then compare that with
the value on exit. to determine if it has changes.
Where and how you do this will vary depending on whether the form
field is a "Word forms: field", a control from the control toolbox,
or an activex object. each of these may have a property that can be
"cajoled" (my expression for using something in a way it was not
specifically designed for) into holding the original value. eg if it
has a Tag property (some VBA forms controls have this) you could store
the original value in that. another may be the default value. etc.



No. The diasplay field shading is an application wide property. When
turned on it works for all fields or none in every document currently
open.


You may be able to do something with a toolbar to show progress by
having a chackbox for each field and setting its value. However I
think that is more trouble than it would be worth. if you have that
many fields and keeping track is a problem my siolution would be to
control everything by putting all of the questions in a VBA form that
way you can condense all of the questions into a smaller area, arrange
them appropriately and do error checking as well. not to mention the
ability to quickly move backwards and forwards. I also prefer this
method because I can let the user see all of the questions "up-front".

Hope this helps.

Cheers!
TonyS.
 
M

Mmay

Thank you, I was afraid I couldn't do anything about the shading but your
suggestion should work great, I don't know why i didn't think about that in
the first place. Just thinking too hard I guess.
 

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