#1   Report Post  
Posted to microsoft.public.word.docmanagement
Kim K Kim K is offline
external usenet poster
 
Posts: 47
Default MAcro help please

I need a script that will run that when a field = a certain answer it will
make the next field a mandatory field to fill in.

Help please.

--
Thanks,,
Kim
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jean-Guy Marcil[_2_] Jean-Guy Marcil[_2_] is offline
external usenet poster
 
Posts: 373
Default MAcro help please

"Kim K" wrote:

I need a script that will run that when a field = a certain answer it will
make the next field a mandatory field to fill in.

Help please.


I think that more information is needed in order to offer help...

Word version?
What is the type of the initial field?
What is the type of this next field?
Are you writing about a protected form (form fields) or a userform (control
fields)?
Who will be using the document?
Is this a template *.dot or a *.doc?
Some content examples would be nice...

And, just to let you know, macro questions should be posted in the
Programming group (microsoft.public.word.vba.general).
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Kim K Kim K is offline
external usenet poster
 
Posts: 47
Default MAcro help please

sorry, was in a hurry:

Word version 03 adn 07 (both will be used in working on the fianl form)
THe initial field is a drop down box with 5 choices,
the next field will be a text field to input information if choice 2 or 3 is
selected in teh drop down box.
The forms will be protected when finished
Staff from 7 different school corp's will be using the forms in a *.dot
format.

and lastly sorry bout posting here...........


--
Thanks,,
Kim


"Jean-Guy Marcil" wrote:

"Kim K" wrote:

I need a script that will run that when a field = a certain answer it will
make the next field a mandatory field to fill in.

Help please.


I think that more information is needed in order to offer help...

Word version?
What is the type of the initial field?
What is the type of this next field?
Are you writing about a protected form (form fields) or a userform (control
fields)?
Who will be using the document?
Is this a template *.dot or a *.doc?
Some content examples would be nice...

And, just to let you know, macro questions should be posted in the
Programming group (microsoft.public.word.vba.general).

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jean-Guy Marcil[_2_] Jean-Guy Marcil[_2_] is offline
external usenet poster
 
Posts: 373
Default MAcro help please

"Kim K" wrote:

sorry, was in a hurry:

Word version 03 adn 07 (both will be used in working on the fianl form)
THe initial field is a drop down box with 5 choices,
the next field will be a text field to input information if choice 2 or 3 is
selected in teh drop down box.
The forms will be protected when finished
Staff from 7 different school corp's will be using the forms in a *.dot
format.

and lastly sorry bout posting here...........


With protected form, the only way to enforce the filling out of some fields,
is to have code run before the form is closed/saved/printed. This is advanced
VBA that is beyond the scope of a simple post in these groups.

If you can use a userfom instead, the code would be much easier, but still,
not beginner stuff!

In case you want to use a userform, see here for more info on how to build
them. If you try, post back in the Programming group (or userfrom group if
you have access):
http://word.mvps.org/faqs/Userforms/index.htm

Or, if you can live with just a reminder popping up, you can have a message
displayed when a particular choice is selected in the dropdown, but you could
not enforce the fact...
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Kim K Kim K is offline
external usenet poster
 
Posts: 47
Default MAcro help please

I can deal wiht the rminder, any help on hits you can offer wil help me meet
my deadline of the rest of my forms!
--
Thanks,,
Kim


"Jean-Guy Marcil" wrote:

"Kim K" wrote:

sorry, was in a hurry:

Word version 03 adn 07 (both will be used in working on the fianl form)
THe initial field is a drop down box with 5 choices,
the next field will be a text field to input information if choice 2 or 3 is
selected in teh drop down box.
The forms will be protected when finished
Staff from 7 different school corp's will be using the forms in a *.dot
format.

and lastly sorry bout posting here...........


With protected form, the only way to enforce the filling out of some fields,
is to have code run before the form is closed/saved/printed. This is advanced
VBA that is beyond the scope of a simple post in these groups.

If you can use a userfom instead, the code would be much easier, but still,
not beginner stuff!

In case you want to use a userform, see here for more info on how to build
them. If you try, post back in the Programming group (or userfrom group if
you have access):
http://word.mvps.org/faqs/Userforms/index.htm

Or, if you can live with just a reminder popping up, you can have a message
displayed when a particular choice is selected in the dropdown, but you could
not enforce the fact...



  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Jean-Guy Marcil[_2_] Jean-Guy Marcil[_2_] is offline
external usenet poster
 
Posts: 373
Default MAcro help please

"Kim K" wrote:

I can deal wiht the rminder, any help on hits you can offer wil help me meet
my deadline of the rest of my forms!


Place this Sub in the ThisDocument module.
Then, in the dropdown porperty dialog box (double-click on it in editing
mode - before applying the protection), associate the "Run macro on Exit"
with he following macro:



Sub MessageDrop()

'Name of field that must be filled, _
Change the text between the quotes.
Const strFieldName As String = "ImportantInformation"

With Selection.FormFields(1).DropDown
Select Case .Value
'Code works with second and third item in drop down
Case 2, 3
MsgBox "You must complete the """ & strFieldName & """ field.", _
vbExclamation, "Important!"
End Select
End With

End Sub

  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Kim K Kim K is offline
external usenet poster
 
Posts: 47
Default MAcro help please

Thank you Jean-guy, would this work similarily with a simple pop up box at my
last textfield of drop dpwn to say something like, please be sure infomraitno
is complete before saving, not a blank field macro as some fields will remain
blank due to student demographic info, but just a reminder to check work
before saving.
--
Thanks,,
Kim


"Jean-Guy Marcil" wrote:

"Kim K" wrote:

I can deal wiht the rminder, any help on hits you can offer wil help me meet
my deadline of the rest of my forms!


Place this Sub in the ThisDocument module.
Then, in the dropdown porperty dialog box (double-click on it in editing
mode - before applying the protection), associate the "Run macro on Exit"
with he following macro:



Sub MessageDrop()

'Name of field that must be filled, _
Change the text between the quotes.
Const strFieldName As String = "ImportantInformation"

With Selection.FormFields(1).DropDown
Select Case .Value
'Code works with second and third item in drop down
Case 2, 3
MsgBox "You must complete the """ & strFieldName & """ field.", _
vbExclamation, "Important!"
End Select
End With

End Sub

  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Jean-Guy Marcil[_2_] Jean-Guy Marcil[_2_] is offline
external usenet poster
 
Posts: 373
Default MAcro help please

"Kim K" wrote:

Thank you Jean-guy, would this work similarily with a simple pop up box at my
last textfield of drop dpwn to say something like, please be sure infomraitno
is complete before saving, not a blank field macro as some fields will remain
blank due to student demographic info, but just a reminder to check work
before saving.


Of course, you can use this on all or just some of the dropdowns. Just
modify the Case Select to have it react to the values in the dropdown you
want. For now, because it is easier, just use as many different macros (each
with a unique name) as you have dropdowns. You can remove the Select case if
you want it to display a message regardless of the values in the dropdown.

As for some sort of message in the last drpdown, the only problem is that
you cannot guarantee that all users will click into, much less click out of,
the last dropdown field. I, however, can guarantee that some users will not
use/click into that last dropdown! ;-)
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
Spell Check a protected Form with a Macro & already have forms picture macro [email protected] Microsoft Word Help 2 October 25th 07 04:11 PM
Macro cannot be found or has been disabled because of Macro settin JD2 Microsoft Word Help 5 March 15th 07 04:00 AM
Pause an executing Word Macro to enter info and then Macro continu strongwell Microsoft Word Help 1 August 11th 06 06:57 PM
macro runs from keyboard, but not from macro button-why? BobW Microsoft Word Help 7 May 10th 06 11:33 PM
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th 04 12:40 PM


All times are GMT +1. The time now is 10:44 AM.

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"