Loop Until Problem

S

spunkymuffmonkey

Hi,

Could somebody please help me by explaining the best solution to my problem,
which is:

I would like to make a particular formfield mandatory, the formfield is a
picklist and is half way through my document, the default text is "--Please
Select--" and there are five other entries within the picklist:

Substantiated
Partly Substantiated
Not Substantiated
Not Determined/Inconclusive
No Further Action

I envisaged it working by employing the following code as an exit macro:

Sub MandatoryField()

Dim strOutcome As String

strOutcome = ActiveDocument.FormFields("CaseConclusion").Result

Do While strOutcome = "--Please Select--"

MsgBox "Please ensure that you have selected a Case Conclusion from the
options in the picklist.", vbCritical, "No Option Selected"

ActiveDocument.FormFields("CaseConclusion").Select

Loop

End Sub

Although the validation text does appear when --Please Select-- is selected
I am allowed to move to the next formfield without looping.

If anybody could give me a clue as to where I am going wrong I would be
extremely grateful.

Thanks for looking.
 
S

spunkymuffmonkey

As always Jay, many many thanks indeed, may your weekend be joyous and your
Monday morning be distant!
 

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