S
Steve
Hello,
Is it possible to assign a single onexit macro for various formfields using
the following code?
Sub TabOrder()
Dim StrCurFFld As String, StrFFldToGoTo As String
'First get the name of the current formfield
If Selection.FormFields.Count = 1 Then
'No textbox but a check- or listbox
StrCurFFld = Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0 Then
'Textbox
StrCurFFld = Selection.Bookmarks(Selection.Bookmarks.Count).Name
End If
'Then find out which formfield to go to next ...
Select Case StrCurFFld
Case "Dropdown1"
StrFFldToGoTo = "Dropdown2"
Case "Dropdown2"
StrFFldToGoTo = "Dropdown3"
Case "Dropdown3"
StrFFldToGoTo = "Text1"
End Select
'... and go to it.
ActiveDocument.Bookmarks(StrFFldToGoTo).Range.Fields(1).Result.Select
End Sub
Is it possible to assign a single onexit macro for various formfields using
the following code?
Sub TabOrder()
Dim StrCurFFld As String, StrFFldToGoTo As String
'First get the name of the current formfield
If Selection.FormFields.Count = 1 Then
'No textbox but a check- or listbox
StrCurFFld = Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0 Then
'Textbox
StrCurFFld = Selection.Bookmarks(Selection.Bookmarks.Count).Name
End If
'Then find out which formfield to go to next ...
Select Case StrCurFFld
Case "Dropdown1"
StrFFldToGoTo = "Dropdown2"
Case "Dropdown2"
StrFFldToGoTo = "Dropdown3"
Case "Dropdown3"
StrFFldToGoTo = "Text1"
End Select
'... and go to it.
ActiveDocument.Bookmarks(StrFFldToGoTo).Range.Fields(1).Result.Select
End Sub