Discussion Locked

TextBox won't hold focus on Word 97 form

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
First, turn on the "Forms" and the "Control Toolbox" toolbars. Then add a Text Form Field or Check Box from the "Forms" toolbar, on a new document. Of course, you can quickly and easily build a form like this, and protect it, and you can just tab through or click on each field. But, if you add a Text Box from the "Control Toolbox", then protect the document, the new Text Box won't hold the focus. What I mean is, if you Tab through, it just jumps over the Text Box, and if you try to click on it, it activates, while you hold the click, but as soon as you let up, it jumps to the next normal form field. I can even hold down the click and enter one character into the Text Box. As soon as I hit the one character, it again jumps to the next form field. What's up with that? I really need to have several Text Boxes in a form, but they aren't working.

3 replies

by Member 22879628

Drake:

You are dealing with two totally different animals that don't really mix well. Items from the Control Tool Box are Visual Basic for Applications (VBA) controls or objects. While they may be placed in a document, they have little use there and are primarily meant to be used on a VBA Forms. When placed on a VBA Form, they have a Tab Index and other properties that allow you to tab between objects, edit them and launch VBA program code. The only way I am aware of accessing and working with VBA Forms is thorough the VBA interface (press ALT-F11 while in Word).

The other animal you are dealing with is WORD FORMS and items from the Forms tool bar. When you protect the document for Forms, you are asking Word to freeze all text,tables, paragraphs, etc...including VBA objects. From that point on, only WORD Forms objects and items are available for editing. VBA controls are not Word Forms objects, so they are not available for editing. So the problem is not exactly one offocus, it is that the Text Box you added from the Control Tool Box becomes just like the background or paragraph text once you protect for Forms.

Which one do you want to use? Well that would depend heavily on what you are trying to do and your level of comfort with VBA. Hope this clears things up a little...let me know if you need something more...thanks.

This discussion is closed to new replies.