Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On current event when deleting

Status
Not open for further replies.

FurryGorilla

Technical User
Apr 11, 2001
76
0
0
GB
Hi

I have some code in the 'on current' event of a form which displays a message box depending on the status of a field on the form.

When I delete a record, I ask the user if they would like to delete this record. if they confirm this, two commands are called:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

I then have an 'after del confirm' event which notifies the user that the record has been deleted.

Unfortunately the 'on current' event is called before the 'after del confirm' event which seems a little strange. Is there a way of preventing this from happening?

Also if someone could let me know what each of the commands above does I would be grateful (I've looked in the help files but can't make any sense of it)

Many thanks
Chris
 
move your on current to either Delete, BeforeDelConfirm, or AfterDelConfirm Events. there's three events with delete, Delete, BeforeDelConfirm, AfterDelConfirm Events.

see access help: Delete, BeforeDelConfirm, AfterDelConfirm Events Cruz'n and Booz'n always.
This post shows what little I do at work.
 
there's also an Updated Event. see access help for more informatoin. Cruz'n and Booz'n always.
This post shows what little I do at work.
 
Sorry, I don't understand what you're getting at. I need the code in the 'on current' event so as the user moves through the records they are sent a message depending on the status of record. If it is taken out of the 'on current' event it won't be displayed at all.

Unless I can place the 'on current' event somewhere else?
 
ya, i misunderstood your question at first. :) Sorry about the confusion.

You want something to happen on your oncurrent - but when you delete a record you want the on delete confirm to happen before the oncurrent for the next record that pops up b/c you just deleted a record.

I misunderstood completely.

well, it goes in this order when you delete a record:

current (when you first load the form)
delete (when you click delete)
Current
Before delete
After delete
Cruz'n and Booz'n always.
This post shows what little I do at work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top