VBA - Add New Issue

  • Thread starter Thread starter travis_5579
  • Start date Start date
T

travis_5579

Hi ,

I have created a form in Access and I bound all my
texboxes to one of the table.
I perform the Add New command :
"DoCmd.GoToRecord , , acNewRec"
and I enter the values in my textboxes.I like to cancel
this updates after I enter
all the values in the textboxes.I perform this command :

"DoCmd.DoMenuItem acFormBar,acEditMenu,acSelectRecord,,
acMenuVer70"

"DoCmd.DoMenuItem acFormBar, acEditMenu,acDelete, ,
acMenuVer70"

but this will display a delete screen for me to select
'Yes' or 'No'.
I want to delete this record without selecting any of this
options.
This means that if the user cancel this transaction , this
transaction will deleted straight away without prompting
any options for user to select.Is it possible to do that ?
 
Instead of saving the deleting the record, you could undo it:

If Me.Dirty Then
Me.Undo
End If
If Not Me.NewRecord Then
'It's already been saved and needs to be deleted here.
End If

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
Back
Top