Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Word VBA tabbing

Status
Not open for further replies.

dprayner

Programmer
Oct 14, 2002
140
US
Hi good people.

I have a Word Document with a drop-down box and about a dozen free form text fields.

I was wondering if the was a way to programatically tab to the next field after the field limit has been reached.

I am having trouble referencing the "objects" by their bookmark names. This is a simple matter on a VB form where I can reference the objects and their On Change Subroutines.

Thank you, DAVE
 




Dave,

Why can't you TAB to the next formfield?

Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
We can, but the folks that I work with want the tab to be automatic. DAVE
 




There are no EVENTS associated with a formfield that you could test the number of characters.

All you have is an Entry event and an Exit event, I beleive.

Have you tried ControlToolbox controls.

Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
If I understand correctly, you are asking if there something that can continuously count (live and real-time) the characters in the formfield. If the count reaches X, then automatically Tab to the next formfield.

Skip is correct. You can not do what you are asking with formfields. You might trying doing it with ActiveX controls, as they do have a _Change event.
I am having trouble referencing the "objects" by their bookmark names. This is a simple matter on a VB form where I can reference the objects and their On Change Subroutines.
Actually, it is better to reference formfields objects as formfields, not as bookmarks. You can reference them as bookmarks (as they are bookmarks, ie. named ranges) but you get more available properties when you referenece them from the FormFields Collection.

However, the connection to controls on a userform is zero. There are no formfields on userforms. So.....no Change events.

faq219-2884

Gerry
My paintings and sculpture
 
Great tip guy. I tried to added ActiveX controls and they work well, except there doesn't seem to be a way to .SetFocus to a control as on VB forms and it won't manually tab now. Any suggestions? DAVE
 
Hi guys.

I tried using the AutoTab property which seems to work well. I had forgotten that the Document works differently when not protected. When I protected it, it worked find with the MaxLength property set. Thank you for your help. DAVE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top