Applecore Pages on Microsoft Access

Suppressing multiple lines in a Text Box

If you only want the user to be able to enter one line of text in a text box, then you can leave the 'Enter key Behaviour' as Default, but you will also need to trap any presses of Ctl-Enter. Here is some sample code to do this:

Private Sub txtName_KeyDown(keycode As Integer, shift As Integer)
    Dim varShift As Variant
    varShift = (shift And CTRL_MASK)
    If varShift And (keycode = 13) Then keycode = 0
End Sub

Top

 


HOME | NEW | TABLES | QUERIES | FORMS | REPORTS | GENERAL | API | DOWNLOADS | TUTORIAL | RESOURCES
E-MAIL
Copyright & Disclaimer

 

Last modified at 06/06/2006 13:54:53