Deleting a record

  • Thread starter Thread starter JeanetteJH
  • Start date Start date
J

JeanetteJH

I have a created a button on a form that will delete the record. It works
fine, but after the deletion, I want it to go to a new record with the focus
being on the first field on the record. I can get to the first field on the
record, but it will not go to a new record. I would think this would be
simple, but I can't seem to figure it out. Any help would be appreciated.

Thanks you, Jeanette
 
In the click event code of your delete button, you can create a new record
like this:

Docmd.GoToRecord acDataForm, Me.Name, acNewRec
 
Thank you - I was again making things harder than they need to be. One last
question about this - How can I put a warning msgbox on this button?

Jeanette
 
If you mean warning about the delete, then

If MsgBox ("Do You Want To Delete This Record", vbQuestion + vbYesNo +
vbDefaultButtonTwo,"Warning") = vbYes Then
'do the delete and add new here
End If
 
Back
Top