Link to home
Start Free TrialLog in
Avatar of ksilvoso
ksilvosoFlag for United States of America

asked on

Lock pagination word form

I have a word form that I want to post online.  I want people to be able to fill in the txt form fields without creating a new line when they hit enter.  Even when I set number limits on the form field this still doesn't take care of the problem.  I don't want people to be able to create a new line when they hit enter.
ASKER CERTIFIED SOLUTION
Avatar of Joanne M. Orzech
Joanne M. Orzech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ksilvoso

ASKER

How does this work?  I can only type in the box by right clicking on it and selecting edit.  Plus it won't wrap the text.
If you use the ActiveX controls, then you can code trap the keypress and stop the enter key.

Dawn Bleuel
Word MVP
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  If KeyCode = 13 Then
    MsgBox "Sorry, you are not allowed to hit the enter " & vbCr & _
      "key while in this field. Type the details and use the " & vbCr & _
      "TAB key to move to the next field."
  End If
  
End Sub

Open in new window

You can also right-click on the control and go to Properties, just change the Multi-Line option to True... it will wrap.
I just caught part of your question that I missed earlier. To type in the field, protect the document. With your document protected you should be able to tab from field to field.

Dawn Bleuel
Word MVP