Using Code to change Tools > Options > Edit/Find > Confirm Record Changes

J

Jan

Does anyone know how to access with code the menu
properties that one can manually set from the menu bar?

Specifically I want to Delete the current record in my
form after I have entered some info from it into an
EventLog table. I confirm the deletion with a MsgBox, then
want to Delete the record without the user being prompted
again to Confirm the deletion of the record.

So I think I want to using code turn off the;

Tools > Options > Edit/Find > Confirm Record Changes

Property and then after I have run the code;

DoCmd.RunCommand acCmdDeleteRecord

then I would turn the Confirm Record Changes property back
on.

Any ideas how to do this?

Jan
 
D

Dirk Goldgar

Jan said:
Does anyone know how to access with code the menu
properties that one can manually set from the menu bar?

Specifically I want to Delete the current record in my
form after I have entered some info from it into an
EventLog table. I confirm the deletion with a MsgBox, then
want to Delete the record without the user being prompted
again to Confirm the deletion of the record.

So I think I want to using code turn off the;

Tools > Options > Edit/Find > Confirm Record Changes

Property and then after I have run the code;

DoCmd.RunCommand acCmdDeleteRecord

then I would turn the Confirm Record Changes property back
on.

Any ideas how to do this?

Jan

You can do that with

Application.SetOption "Confirm Record Changes", False

but I don't recommend doing it that way. Instead, use the statement

DoCmd.SetWarnings False

to temporarily turn warnings off, and then after you've deleted the
record use

DoCmd.SetWarnings True

to turn the warnings back on again. Make sure that you have
error-handling in place so that even in the event of an error, warnings
get turned back on again.
 

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