update query problem

travismp

Registered User.
Local time
Today, 16:59
Joined
Oct 15, 2001
Messages
386
I have 3 or 4 update/delete queries. Right now if a user clicks one of the queries it will first prompt

"you are about to update X amount of rows...are you sure you want to do this action?"

if the user hits "YES" it works fine.
if the user hits "NO" it still finishes the act as if yes was hit.

It never cancels the act.

What is going on?
 
whats the code for the msgbox prompt?

sounds like u need a
cancel=true
on the No button click
 
Are you sure it's deleting the rows or does it just go on to the next set?

A better way to do it might be this:

Code:
   If MsgBox("Are you sure you want to delete these rows?","vbQuestion + vbYesNo,"Delete Confirmation") = vbYes Then
       CurrentDb.Execute "qryNameHere"
   Else
       MsgBox "Delete was canceled", vbInformation, "Action Canceled"
   End If

and that can be in place of where you currently call your queries.
 
thanks so far...

it does it for update queries too.

My account dept each week has to updatew a couple thousand records from not billed to billed with a checkbox. Right now when she clicks the update query it will give her the defualt windows prompt.

if she hits yes it works fine.
if she hits no it still carries out the update.

why would it do this if she hits no?

It is almost like there is some macro or vb script that is open all the time saying "ignore all NO commands"
 
I'm not sure why. But, as Rural Guy has pointed out before, you can avoid the error messages by using CurrentDb.Execute for executing action queries, but you can nest the running of them in your own confirmations so that it will bypass running them if they don't want to.

Maybe someone else has an idea as to why your "No" doesn't seem to cancel it. I'm not really sure.
 
first off thank you for the ideas so far. I do not fully understand your suggestions, but I will sit down Sat morning and see if I can change my system the way you guys are saying. If I have problems I will be back.

Thank you very much so far...
 

Users who are viewing this thread

Back
Top Bottom