Force data entry in form field

G

Guest

I've created a table form using form fields. How can I require users to enter data into one or more fields if they select a specific option in another field. I thought that a macro might work. I'm able to write one that would send users to the required field if they selected option A, but I can't figure out how to stop them from leaving the required field (which is a text field) if they haven't entered data.
 
D

Doug Robbins - Word MVP

Run a macro on exit from the formfield

If ActiveDocument.FormFields("Bookmark Name").Result = "" Then
MsgBox "Please fill in the formfield."
End If

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
hinesgg said:
I've created a table form using form fields. How can I require users to
enter data into one or more fields if they select a specific option in
another field. I thought that a macro might work. I'm able to write one
that would send users to the required field if they selected option A, but I
can't figure out how to stop them from leaving the required field (which is
a text field) if they haven't entered data.
 

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