Results 1 to 2 of 2

Thread: Making the Enter key work with a textbox?

  1. #1

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330
    Hi,
    Is this the proper way to get my program respond to the Enter key the same as if the Command button that says "Go" is clicked?
    It seems to work but is there a better way?
    Code:
    Sub Text1_KeyPress(KeyAscii As Integer)
    Text1.SetFocus
    If KeyAscii = 13 Then GetData
    End Sub
    As always, Thanks.
    Al.

  2. #2
    Set the "Default" property on the command button to True.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width