Re: DoCmd.GoToRecord , , acNewRec
- From: "Ken Snell \(MVP\)" <kthsneisllis9@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 25 Apr 2006 21:44:17 -0400
Tell us more about the form's setup and record source. If no data are
entered by the user or by programming, then a Me.Undo action should avoid
the saving of the new record.
However, if you're using a subform in the form, and the focus moves from the
form in which you've added the new record to the "other" form (main form or
subform), then the newly added record will be saved as part of the focus
move.
--
Ken Snell
<MS ACCESS MVP>
"Rick A" <allisonrja@xxxxxxxxxxx> wrote in message
news:eLTGHTLaGHA.428@xxxxxxxxxxxxxxxxxxxxxxx
I have a button on a bound form that adds a new record. It runs the code -
DoCmd.GoToRecord , , acNewRec
I also have a cancel button in case the person changes their mind. In
testing I press the Add button and then the Cancel button and a new blank
record is added. I want to stop this behavior.
I've tried if me.dirty but since nothing has been typed on the form it's not
dirty. I've tried me.undo but that's not working either.
How do I trap for this and stop the insert of a blank row into the database?
Thanks,
--
Rick
.
- Follow-Ups:
- Re: DoCmd.GoToRecord , , acNewRec
- From: Rick Allison
- Re: DoCmd.GoToRecord , , acNewRec
- Prev by Date: Re: Combo box handling
- Next by Date: Re: Determine if I'm at the last record in recordset
- Previous by thread: Re: Combo box handling
- Next by thread: Re: DoCmd.GoToRecord , , acNewRec
- Index(es):