cancel update of record

  • Thread starter Thread starter Chegu Tom
  • Start date Start date
C

Chegu Tom

I want to put a button on my form with code that will tell access to close
the form and not update the current record.

Assuming the user has entered information on the form and then reailzes he
doewnt want that info in the database

Thanks
 
I want to put a button on my form with code that will tell access to close
the form and not update the current record.

Assuming the user has entered information on the form and then reailzes he
doewnt want that info in the database

Thanks

Use the Code Builder to put into the [Event Procedure] of the command button's
click event:

Private Sub cmdQuit_Click()
Me.Undo ' erase all changes to the current record
DoCmd.Close acDataForm, Me.Name ' close the form
End Sub

John W. Vinson [MVP]
 
me.Undo

me.DUH or me.DOH (Homer Simpson style)

Thanks. For some reason I could not remember that.

Tom

John W. Vinson said:
I want to put a button on my form with code that will tell access to close
the form and not update the current record.

Assuming the user has entered information on the form and then reailzes he
doewnt want that info in the database

Thanks

Use the Code Builder to put into the [Event Procedure] of the command
button's
click event:

Private Sub cmdQuit_Click()
Me.Undo ' erase all changes to the current record
DoCmd.Close acDataForm, Me.Name ' close the form
End Sub

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top