![]() |
#1
|
|||
|
|||
![]()
I have a multiple-page Word form that has many fields, most of which are optional. I have been able to add Visual Basic modules to certain form fields at the beginning of the form to require those fields be completed -- these are fields that contain some type of text or date fields. There are other fields that contain drop down menus, some of which contain 2-3 options, others that contain many more options, but they are all single choice menus. The code I'm using for the text fields does not work with the drop-down fields and I don't know how to write the code to be used with these fields. Can someone provide the code or direct me to a source with this information?
|
#2
|
|||
|
|||
![]()
By fields, I will assume you mean formfields. Formfield dropdowns by design can't be empty. They have to contain one of the list items that you define.
E.g., you might define "Choose Letter" as the first entry then A, B, C, D etc. Sub ValidateFFs() Dim oFF As FormField For Each oFF In ActiveDocument.FormFields Select Case oFF.Name Case "Dropdown1" If oFF.Result = "Choose Letter" Then oFF.Range.Select MsgBox "This field must have a valid selection" Exit For End If Case "Text1" 'Your code for validating the Text1 field. End Select Next oFF End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
proking | Word VBA | 9 | 01-07-2020 10:05 AM |
Activate (show) a Drop-down form field when another drop-down form field is selected from | Jentis | Word VBA | 1 | 04-19-2018 09:42 PM |
Word Form/ActiveX drop down menu/value in a different field | AMackenzieFFCU | Word VBA | 1 | 01-14-2013 07:48 AM |
![]() |
KateAus | Word VBA | 4 | 09-09-2012 08:40 PM |
![]() |
gurp99 | Word VBA | 11 | 03-12-2012 04:05 PM |