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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab feature between Text Boxes in Word? 1

Status
Not open for further replies.

wwgmr

MIS
Mar 12, 2001
174
0
0
US
Hello all. I know that in VB and VB .net you can set Tab values to objects. I am trying to create on a word page Text boxes to enter data into. I would like to be able to Tab from box to box. Example Enter First name and last. I enter first then hit tab or enter and I go to next box.

I don't see this option in Properties where I would see it in VB. Can anyone help with this? Also is it possible to password protect changes to some of the Text boxes and not others?


Thanks alot!
Eric
 
Hi Eric,

On a VBA Userform you can set the tab-order by rightklicking on the userform. There you will find the option "taborder". Or you can use the property TabIndex on the properties list.

I do not really understand you last question... you want some fields disabled?

Regards,
Unica
 
Thank you as I am using a word document as background then placing the text boxes on the page where would I find the tab order?

Second question was I wan't to have say a field that says Approved maybe even check box most likely it will be a List box. I don't want everyone using this sheet to be able to change that box. Is there way to Password protect that box?

I could use a simple on select event but anyone could access the VB of the page and perhaps see what I am looking for on password. I was looking for another way.

 
Eric,

If you are using textboxes in the document itself then you must be talking about the formfields in Word. If you want users to only fill out the fields then you will have to protect your document when you're done making it. (standard toolbar - extra - protect document, choose formfields only). Now when a user opens the document only the (grey) formfield accept input and can be navigated by using the [tab]. If you want to protect a field you can create a procedure which asks for a password (and switch from Selection.FormFields(1).enabled = false to true when the password is correct). If you do not want users to see your VBA code you can password protect you VBA project by filling out a password on the security tab of the VBA project properties while in the VB Editor.

Hope this helps.

Regards,
Unica
 
Hi,

If you want to set a specific order on your document, you will have to put for each of your text boxes a code into the module « ThisDocument » :

Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyTab Then TextBox3.Activate
End Sub


Jean-Paul
Montreal
jp@solutionsvba.com
mtljp2@sympatico.ca
 
Thats what I was afraid of, Okay thank you very much Jean-Paul.

Have great day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top