![]() |
#5
|
|||
|
|||
![]()
First let me say that I know how much submariners love to be inspected so perhaps I shouldn't do more to make it easier on your shop
![]() That said, I also know that submariners don't always appreciate what is best for them so: The first thing you need to do is to assign meaningful bookmark names to your formfields. Continuing from the previous example, lets name the checkbox VT_DIM and the text field B11_1 (That is for block 11, field 1 and perhaps not so meaningful). You could simply create another OnExit macro specifically for the checkbox, but if this is something you want to fully exploit then you should use a single OnExit macro. Something like this: Sub FormFieldOnExit() Dim oFF As FormFields Set oFF = ActiveDocument.FormFields Dim pName As String pName = FieldID Select Case pName Case "Name" Select Case oFF(pName).Result Case "TOPEKA" oFF("UIC").Result = "12345" Case "PASADENA" oFF("UIC").Result = "54321" Case "HELENA" oFF("UIC").Result = "99999" End Select Case "VT_DIM" Select Case oFF("VT_DIM").CheckBox.Value Case "True" oFF("B11_1").Result = "1C" Case Else oFF("B11_1").Result = "" End Select End Select End Sub Function FieldID() As String Dim pFldName As String If Selection.FormFields.Count = 1 Then pFldName = Selection.FormFields(1).Name ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0 Then pFldName = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e End If FieldID = pFldName End Function |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Text Wrapping on Fixed Lines in a Form field/Table cell | okrmjr | Word Tables | 0 | 10-30-2009 08:52 AM |
Outlook 2007, contacts: drop down in custom field | pacecal | Outlook | 0 | 06-16-2009 10:43 AM |
![]() |
Toshii | Word | 1 | 06-08-2009 07:21 PM |
![]() |
Gail L. | Word | 2 | 05-17-2009 12:38 PM |
evaluating a text expression in a form field | gwp1 | Word | 0 | 10-08-2007 02:15 PM |