Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete confirmation

Status
Not open for further replies.

tlaksh

Programmer
Feb 25, 2001
98
US
I am using access 97. My problem is that i am using a delete query to delete records. I call the query at a press of a button. I have a after delete confirm event that pops up a message to confirm that delete has taken place. The confirm option is also on in the options panel. But even then the message is not displayed.

Why is this happening?? Any suggestions??

Thanks

Laksh.
 
One idea. Does your code set warnings off? It would look like this, 'DoCmd.SetWarnings = False'. If it did not turn warnings back on then you would not get the warnings.

Steve King Growth follows a healthy professional curiosity
 
Hi,

Hey ...I have the same problem and i checked and setwarnings is not False.

I was just wondering did u figure out what the problem was??

Thanks for ur help.

TLaksh
 
Open your code and set a breakpoint (F9) on your code, probably the 'if' line, of both the delete and the confirm to determine whether it is firing. Use debug to determine the reason. F8 takes a step at a time.

I suspect that the After Delete event pertains to a form event but not a query. For instance, when you run a delete query and don't suppress the messages you will be informed of the action query being run and the results. This constitutes a separate query action that will probably NOT cause the form After Delete event to fire because it is an independent and separate event. I'm sure if I build and run a SQL statment that deleted records from and unbound form that it wouldn't fire.

Steve King

Steve King Growth follows a healthy professional curiosity
 
Actually, try the codestring "DoCmd.SetWarnings False", instead of using the assignment operator as listed above. At least when using MSAccess97. Took a little while for this novice to figure out the cryptic error message "Argument not optional" when I used the equals sign.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top