In Add Mode - a return at the last field causes a save - I'm not r

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have an issue. I have a form that I have created to cyle one record. I
allow the user to add a record one at a time and the user is supposed to
either click a save button or a cancel button. But once the user has come to
the end of their data entry, it you just happend to press return on the last
field, the record is automatically saved and I don't want that to happen. If
you don't "leave" the last field on the form, it doesn't automatically save
the record.

What can I do to stop this automatic save?
 
You can use the OnExit event of the last field to set the focus back to the
first field in the TAB order

Private Sub LastFieldName_Exit(Cancel As Integer)
Me.FirstFieldName.SetFocus
End Sub
 
Thanks so much! Works like a charm!


Ofer Cohen said:
You can use the OnExit event of the last field to set the focus back to the
first field in the TAB order

Private Sub LastFieldName_Exit(Cancel As Integer)
Me.FirstFieldName.SetFocus
End Sub
 
Back
Top