Is it possible to save a record by just click on Enter keyboard button?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michelle Anderson
    New Member
    • Dec 2006
    • 14

    Is it possible to save a record by just click on Enter keyboard button?

    Hi,
    I am just wonder if it's possible to click on Enter on the keyboard.

    Thanks
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Place a command button on your form.
    Place this code behind it in the code window:
    Code:
    Private Sub SaveRecord_Click()
      If Me.Dirty Then Me.Dirty = False
    End Sub
    Now, in the form's Design View, select the button and go to Properties - Other and set the Default Property to Yes.

    Now, when the <Enter> key is pressed the Command Button's code will be run. Obviously, you can only do this for one button on any given form.

    Linq ;0)>

    Comment

    Working...