By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

Run a delete query without prompts?

100+
P: 111
I have fields that autopopulate so that the user wont have to type in the same info over and over. The only problem with this is that the user can keep hitting new record because this info is automatically being stored and causes a bunch of (basically) blank records in the table. I built a delete query that will delete any records that arent completely filled in. I want it to run when the user is done filling in their form (OnUnload), but i dont want them to be prompted that this query is running (so they dont think they're deleting something important). Is it possible to have a delete query run without the prompts?

Thanks!
Aug 13 '07 #1
Share this Question
Share on Google+
11 Replies


Rabbit
Expert Mod 10K+
P: 12,389
In VBA there's a DoCmd.SetWarnings True/False.
Surround your query with that.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
  2. DoCmd.RunSQL "DELETE ..."
  3. DoCmd.SetWarnings True
  4.  
Aug 13 '07 #2

Scott Price
Expert 100+
P: 1,384
I have fields that autopopulate so that the user wont have to type in the same info over and over. The only problem with this is that the user can keep hitting new record because this info is automatically being stored and causes a bunch of (basically) blank records in the table. I built a delete query that will delete any records that arent completely filled in. I want it to run when the user is done filling in their form (OnUnload), but i dont want them to be prompted that this query is running (so they dont think they're deleting something important). Is it possible to have a delete query run without the prompts?

Thanks!
Have you tried?
Expand|Select|Wrap|Line Numbers
  1. DoCmd.Setwarnings = False
  2. 'Run your delete query here
  3. DoCmd.Setwarnings = True
Regards,
Scott
Aug 13 '07 #3

Scott Price
Expert 100+
P: 1,384
Rabbit, you beat me to it! Must have been posting at the same time again :-(

Regards,
Scott
Aug 13 '07 #4

Rabbit
Expert Mod 10K+
P: 12,389
Rabbit, you beat me to it! Must have been posting at the same time again :-(

Regards,
Scott
I'm quick like a fox.
Aug 13 '07 #5

100+
P: 111
you guys are the best!

Thanks!
Aug 13 '07 #6

Rabbit
Expert Mod 10K+
P: 12,389
Not a problem, good luck.
Aug 13 '07 #7

missinglinq
Expert 2.5K+
P: 3,532
Fox? Rabbit? They were all VWs, weren't they?
Aug 13 '07 #8

Rabbit
Expert Mod 10K+
P: 12,389
Fox? Rabbit? They were all VWs, weren't they?
I know the Rabbit is one. I don't know about the Fox.
Aug 13 '07 #9

Scott Price
Expert 100+
P: 1,384
I know the Rabbit is one. I don't know about the Fox.
So why did the Rabbit look so much like a turtle??

Oh, right, that was the Beetle ;-) LOL
Aug 13 '07 #10

missinglinq
Expert 2.5K+
P: 3,532
Actually the Fox looked kind of like the Rabbit. It was made in South America, Brazil I think and imported here in the late 8os to early9os.
Aug 13 '07 #11

Scott Price
Expert 100+
P: 1,384
Actually the Fox looked kind of like the Rabbit. It was made in South America, Brazil I think and imported here in the late 8os to early9os.
And then after the Rabbit came the Golf! I remember now...

Actually didn't the Fox become the Scirroco, or something like that?

(Don't get any ideas about your second career, Rabbit... I think Tiger's got that field all sewed up :-) LOL
Aug 13 '07 #12

Post your reply

Sign in to post your reply or Sign up for a free account.