Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Leslie
 
Posts: n/a
Default Question the MVP article "How to set the tab order of a Word f

I have adapted an Omniform form into Microsoft Word 2002. I found that it
that needed to have the tab settings reset. I found the MVP article about
setting the tab order and followed the instructions in Method 2: "assign a
single OnExit macro to all your form fields". My form is a mixture of text
and check boxes. After completing the macro as instructed, I found that I
can tab to text boxes, but it will not tab to the check boxes. Below is the
macro with a sample of the fields listed. "ServiceAM1" and "ServicePM1" are
check boxes, the remaining fields are text boxes:
Please help me! I've been working on this all day and am at the end of my
rope. Thanking you in advance,
Leslie

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).Nam e
End If

'Then find out which formfield to go to next ...
Select Case StrCurFFld
Case "Name"
StrFFldToGoTo = "ClientID"
Case "ClientID"
StrFFldToGoTo = "ServiceMonth1"
Case "ServiceMonth1"
StrFFldToGoTo = "ServiceDay1"
Case "ServiceDay1"
StrFFldToGoTo = "ServiceYear1"
Case "ServiceYear1"
StrFFldToGoTo = "ServiceHour1"
Case "ServiceHour1"
StrFFldToGoTo = "ServiceMinute1"
Case "ServiceMinute1"
StrFFldToGoTo = "ServiceAM1"
Case "ServiceAM1"
StrFFldToGoTo = "ServicePM1"
End Select
'... and go to it.
ActiveDocument.Bookmarks(StrFFldToGoTo).Range.Fiel ds(1).Result.Select

End Sub

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Bill Coan
 
Posts: n/a
Default Question the MVP article "How to set the tab order of a Word f

Hi Leslie,

Try changing the final line of code to the following, and see if it works
any better:
ActiveDocument.Bookmarks(StrFFldToGoTo).Range.Fiel ds(1).Select

You might even try:
ActiveDocument.Bookmarks(StrFFldToGoTo).Select


Bill Coan

"Leslie" wrote in message
...
I have adapted an Omniform form into Microsoft Word 2002. I found that it
that needed to have the tab settings reset. I found the MVP article about
setting the tab order and followed the instructions in Method 2: "assign
a
single OnExit macro to all your form fields". My form is a mixture of
text
and check boxes. After completing the macro as instructed, I found that I
can tab to text boxes, but it will not tab to the check boxes. Below is
the
macro with a sample of the fields listed. "ServiceAM1" and "ServicePM1"
are
check boxes, the remaining fields are text boxes:
Please help me! I've been working on this all day and am at the end of my
rope. Thanking you in advance,
Leslie

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).Nam e
End If

'Then find out which formfield to go to next ...
Select Case StrCurFFld
Case "Name"
StrFFldToGoTo = "ClientID"
Case "ClientID"
StrFFldToGoTo = "ServiceMonth1"
Case "ServiceMonth1"
StrFFldToGoTo = "ServiceDay1"
Case "ServiceDay1"
StrFFldToGoTo = "ServiceYear1"
Case "ServiceYear1"
StrFFldToGoTo = "ServiceHour1"
Case "ServiceHour1"
StrFFldToGoTo = "ServiceMinute1"
Case "ServiceMinute1"
StrFFldToGoTo = "ServiceAM1"
Case "ServiceAM1"
StrFFldToGoTo = "ServicePM1"
End Select
'... and go to it.
ActiveDocument.Bookmarks(StrFFldToGoTo).Range.Fiel ds(1).Result.Select

End Sub



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
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions Microsoft Word Help 22 May 20th 23 08:51 PM
Converting WordPerfect 12 files to Word 2003 Curious New Users 4 May 19th 23 02:48 PM
Reveal codes in a word document FUN101 Microsoft Word Help 4 May 16th 23 08:47 PM
Word & WordPerfect MrsMac Microsoft Word Help 5 June 10th 06 03:14 AM
Converting Word Perfect forms to Word forms elyse Microsoft Word Help 1 February 15th 06 08:17 PM


All times are GMT +1. The time now is 07:38 PM.

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"