none
Text Box Only use 1 Line Only

    Question

  • Is it possible that the text box will only let you use the top line and not be able to use [enter] to go down to the next line!

    Thanks for any help Bob

    Monday, October 07, 2013 8:07 AM

Answers

  • >>Is it possible that the text box will only let you use the top line and not be able to use [enter] to go down to the next line!<<

    No, it is not possible.  After all, the "new line" is simply 2 characters  (CR + LF) and Access interprets the characters to display the "new line".

    Whether you can use the Enter key to insert a "new Line" in the TextBox depends on the setting of the Property "Enter Key Behaviour" of the TextBox.  If you leave it as "Default", then you need to use Ctrl + Enter to insert a "new line".  If you change the property to "New line in Field", then you can use the Enter key to insert a "new line" in the TextBox Control.


    Van Dinh



    Monday, October 07, 2013 12:38 PM

All replies

  • if I remember correctly, line brake in text box is: Ctrl+Enter, you can use Key Down Event to prevent line brake:

    Private Sub Tekst0_KeyDown(KeyCode As Integer, Shift As Integer)
        Dim intCtrlDown As Integer
        intCtrlDown = (Shift And acCtrlMask) > 0
        If intCtrlDown And KeyCode = 13 Then
            KeyCode = 0
        End If
    End Sub

    If only enter go to new line:

    Private Sub Tekst0_KeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = 13 Then
            KeyCode = 0
        End If
    End Sub


    Michał

    Monday, October 07, 2013 11:08 AM
  • >>Is it possible that the text box will only let you use the top line and not be able to use [enter] to go down to the next line!<<

    No, it is not possible.  After all, the "new line" is simply 2 characters  (CR + LF) and Access interprets the characters to display the "new line".

    Whether you can use the Enter key to insert a "new Line" in the TextBox depends on the setting of the Property "Enter Key Behaviour" of the TextBox.  If you leave it as "Default", then you need to use Ctrl + Enter to insert a "new line".  If you change the property to "New line in Field", then you can use the Enter key to insert a "new line" in the TextBox Control.


    Van Dinh



    Monday, October 07, 2013 12:38 PM
  • Thanks Van, worked perfect so I should use Default On Key Behaviour when my text box is only one line high

    Regads Bob

    Tuesday, October 08, 2013 1:25 AM