Cancel Add Mode with Required Fields

  • Thread starter Thread starter Piperlynne
  • Start date Start date
P

Piperlynne

I have a form that puts the user into data entry mode when they click a
command button. But I want to have the ability for the user to cancel that
mode if they need to go look something else up.
There are required fields in the table the form is writing to. If the user
wants to cancel at this point, they have to close the entire database. Help!!
 
I have a form that puts the user into data entry mode when they click a
command button. But I want to have the ability for the user to cancel that
mode if they need to go look something else up.
There are required fields in the table the form is writing to. If the user
wants to cancel at this point, they have to close the entire database. Help!!

They can hit the <Esc> key twice (once to cancel the entry for the control
that has the focus, the second time to cancel the entire record). If you
prefer, you can put a "Cancel" button on the form which cancels the entry:

Private Sub cmdCancel_Click()
Me.Undo
End Sub

Or use a Macro with Undo as its action.
 
Back
Top