BeforeDelConfirm/Delele events (in a from on a Tab Control)

S

Soddy

Hello!

Once again, I'm confused about 'Tab' Controls! I have a 'form' on a (3)
tabbed control. This form uses a table 'query' to populate itself in the
form 'open' event. I have (2) command buttons on the form - (1) to Delete
the record and (1) to Update the record. When I 'Delete' the record, the
default response is brought up. If I Select 'No' another messagebox comes up
saying the 'SQL' was cancelled (I use a SQL statement to Delete/Update the
record in the table).

I would like to 'trap' the Delete event and use a 'customized' messagebox,
but not sure how to 'trap' the Delete event (or BeforeDelConfirm event) on a
'Tab' Control form...
 
S

S Isfeld

Soddy said:
Hello!

Once again, I'm confused about 'Tab' Controls! I have a 'form' on a (3)
tabbed control. This form uses a table 'query' to populate itself in the
form 'open' event. I have (2) command buttons on the form - (1) to Delete
the record and (1) to Update the record. When I 'Delete' the record, the
default response is brought up. If I Select 'No' another messagebox comes up
saying the 'SQL' was cancelled (I use a SQL statement to Delete/Update the
record in the table).

I would like to 'trap' the Delete event and use a 'customized' messagebox,
but not sure how to 'trap' the Delete event (or BeforeDelConfirm event) on a
'Tab' Control form...

could try:

DoCmd.SetWarnings False

if msgbox ("Delete record?", vbYesNo) = vbYes then
<place existing delete code here>
end if

DoCmd.SetWarnings True

on the onclick event for your delete button, of course this wont work if
they select delete record from the menu. setwarnings false will diable the
built in access confimation for delete and warning when canceled.
 
S

Soddy

Okay, jock!! Works really good, thanks alot!!

So, while I have you here - how are you with 'shortcut/hotkeys' on the 'tab'
controls? I have the (3) tabs and want to select a letter from the tab
caption and make it a 'shortcut/hotkey' (so I can select any of the tabs
using the shortcut/hotkey). I tried putting the '&' in front of a letter in
the tab's captions, but it didn't work...
 
S

S Isfeld

Used the & in the caption on a tab before and it's always worked for me.
Might want to post this as a new topic. Not sure why it's not woring for you.
 

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