Delete confirmation dialog box hidden (1 Viewer)

F

forces4

Guest
I have a subform which displays invoice records, but when I try to delete a record from it the delete confirmation dialog box pops up under the form and freezes the program. Pressing the "ALT" key brings it forward, but my boss can't seem to remember to do that.

I have a temporary fix that minimizes the form when you delete a record so that the delete confirm is visible, and maximizes the form after confirmation is made, but this seems like a cheap trick and I am looking for a better way. The issue only arises when the form is sized larger than a certain size with high screen resolution, has no problem being maximized at 1024 x 768. With higher resolution, there is no problem if the form is resized below about 3/4th of the screen size, make the form a little larger and the issue arrises.

I am guessing that in 2000 MS did not anticipate such large screen resolutions like 1600 x 1200, and it somehow kills the delete confirms' ability to take focus. If anybody has any insight into this I would appreciate it. I have to keep the database in Access 2000 format though to make it compatible with a fireworks choreography program, I bet later versions do not suffer from the same bug.

Thanks!

--Rob Wolverton
AM Pyrotechnics
 

DevastatioN

Registered User.
Local time
Today, 05:00
Joined
Nov 21, 2007
Messages
242
DoCmd.Setwarnings False

'Delete record code

DoCmd.Setwarnings True

This should do what you want, it will no longer prompt for deletion. You can also have your own msgbox YesNo popup if that helps the program get the focus of the messagebox.
 
F

forces4

Guest
I was afraid of that, though I have spent more time trying to fix this the easy way :confused: than what it would have taken me to dust off my SQL delete query syntax...
 

brickelldb

Registered User.
Local time
Today, 04:00
Joined
Mar 9, 2009
Messages
70
My users are using my app with 'ms access runtime 2003'. I have not been able to figure out how to disable the warnings for 'delete, update, action' on their machines running access runtime.

Would this resolve my issue? Where exactly would I place this code?

Any help would be GREAT as I have a demo in 2 hours (LOL) !!!
 

DevastatioN

Registered User.
Local time
Today, 05:00
Joined
Nov 21, 2007
Messages
242
Hello,

You need to go into the code where your delete code takes place.

Put DoCmd.Setwarnings False right before the code, and
DoCmd.Setwarnings True right after the code.


For example, if you have a button for deleting a record, go into that button's OnClick event properties. Your first line should read DoCmd.Setwarnings False
and your last line should read DoCmd.Setwarnings True. In between should be the same code that the button originally used.

If you need further clarification, let me know.
 

brickelldb

Registered User.
Local time
Today, 04:00
Joined
Mar 9, 2009
Messages
70
Wow, thanks for the quick reply!! Let me ask you, I actually am Looking to disable ALL warnings....delete records, update records, etc etc.....do i need to one of these for every single button in my app or is there a way to set it once when the app loads to disable warnings across the board?

*** BTW it worked like a charm****
 
Last edited:

DevastatioN

Registered User.
Local time
Today, 05:00
Joined
Nov 21, 2007
Messages
242
I tend to reply quick when at work ;) As long as I'm still subscribed to the thread!

If you want to disable all warnings altogether, forever, then when the main database form loads, you need an "On Load" or "On Open" Procedure that simply runs:

DoCmd.SetWarnings False

The problem with this usually is that, this disables all database warnings, even potential error messages that are useful. If the user is having a problem, you'll have to go in and set the Warnings back to true just to figure out what the error was, or what is causing the error. I believe it also disables the "this is a duplicate key violation!" warning.

So, in theory you can disable all warnings in the database on the open or load procedures, which would be very good and timely for your demo (quick fixes are nice for demos!). But in practice when you have more time I would recommend going in and using this code on every button you for sure never want to display a warning/error message with.

Hopefully this helps, I believe what I've said about the error messages being disabled as well is true... but maybe someone else around here with more experience using this method can correct me.
 

brickelldb

Registered User.
Local time
Today, 04:00
Joined
Mar 9, 2009
Messages
70
That's a great point - I didn't even think of that.

And hey, the onClick event worked PERFECT (not sure if you read the edit to my post). Thanks again for your help - you saved my demo - I was wigging out since I never tested on runtime before late last night. THANKS AGAIN !
 

DevastatioN

Registered User.
Local time
Today, 05:00
Joined
Nov 21, 2007
Messages
242
No problem, glad I was able to help!

Good luck with your demo.
 

Users who are viewing this thread

Top Bottom