Delete Queries: Two questions

chris990

Registered User.
Local time
Yesterday, 20:23
Joined
Sep 9, 2005
Messages
25
Hey guys, I got two questions about delete queries,

Question 1: Is it possible to use the delete query to delete records from two different tables? What I'm looking at is deleting a customer from a customer list, and customer records from a distribution list, which are in two different tables. If not, is there an alternative way to accomplish this....ie write two queries but use macros somehow?

Question 2: I would like to add an "Are you sure?" message-box type feature into the delete query so that the user has the ability to think and back out if neccessary. Any suggestions for accomplishing that?

Thanks,
Chris
 
If you use a macro, you can put something like 6=MSGBOX(Are You Sure,48,"Delete") (use help for proper syntax) in the condition. Basically it is checking for YES or NO being pressed and conditionally executing MACRO commands depending on the response.
I usually ask the question on a STOP ALL MACROS command, and if they answer to make the condition true, it stops, else it runs the delete query/s.
You can do the same thing using VBA/event procedure. I think the VBA is a little easier to understand a year from now when you have to change it again.
 
Thanks, I think I got the message box thing figured out.

What about the first question....How can you use a delete-query to delete records from 2 tables? Just reading the help-files makes this look like a touchy subject as they mention relationships and other things. Is this a viable way to go, or would 2 delete-queries be a safer solution?
 
2 queries, use the same criteria (like pull from a form field) is best. Make sure to turn warnings off so you don;'t get those stupid questions on each one
 

Users who are viewing this thread

Back
Top Bottom