Tab order / ExitMacros created, but still skipping......

S

skygazerkm

Word 2003
I have a form with several text fields, drop downs and check boxes that I
have added exitmacros to - thanks to the information on other postings!! I
am still having a problem with them going in order, but only a few fields
keep getting skipped. I cannot figure out what I did wrong. I am very new
to forms in Word, so bear with me. I did individual exitmacros because the
strings and "togoto" seemed to complicated for my beginner knowledge. This
is what I have created.

Option Explicit

Sub ExitText1()
ActiveDocument.Bookmarks("Text2").Range.Fields(1).Result.Select
End Sub

Sub ExitText2()
ActiveDocument.Bookmarks("Dropdown1").Range.Fields(1).Result.Select
End Sub

Sub ExitText3()
ActiveDocument.Bookmarks("Text4").Range.Fields(1).Result.Select
End Sub

Sub ExitText4()
ActiveDocument.Bookmarks("Text16").Range.Fields(1).Result.Select
End Sub

Sub ExitText5()
ActiveDocument.Bookmarks("Text6").Range.Fields(1).Result.Select
End Sub

If I understand this all correctly, I want EXITTEXT# to be the field I am in
and then ("TEXT#") where I want to go next. If that is correct, what's
happening to me is that Exittext2 is skipping to text6 and then following the
order. It happens in one other spot where a drop down falls as well, but in
this case I am skipping to a different table, so could that be the problem?
Any suggestions to fix this?
 
J

Jay Freedman

The problem is just that dropdowns are handled differently by VBA than are
text fields. Leave out the .Result when you want to select a dropdown:

Sub ExitText2()
ActiveDocument.Bookmarks("Dropdown1").Range.Fields(1).Select
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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