Disabling multi-line fields in MS Access
问题 Is there a way to disable entering multi-line entries in a Text Box (i.e., I'd like to stop my users from doing ctrl-enter to get a newline)? 回答1: I was able to do it on using KeyPress event. Here's the code example: Private Sub SingleLineTextBox_ KeyPress(ByRef KeyAscii As Integer) If KeyAscii = 10 _ or KeyAscii = 13 Then '10 -> Ctrl-Enter. AKA ^J or ctrl-j '13 -> Enter. AKA ^M or ctrl-m KeyAscii = 0 'clear the the KeyPress End If End Sub 回答2: The way I did it before (and the last time I