VBA - Add New Issue

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 ?
 
A

Allen Browne

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]...
 

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

Top