Not exactly, I try to put it another way.
When you go to Tools : Options : Edit/Find : Confirm and
then un-check Action Query that is what I would like to
achieve. I tried to get help on this before but I don't
think I asked the right question. I think that I need to
run some code with my autoexec macro but what code is the
question.
Thanks for your patience.
Nick
-----Original Message-----
With the Execute method, you do not get any warning
unless something goes
wrong with the deletion. Isn't that what you wanted?
If you did want a confirmation, you could use MsgBox() to
get the user
confirmation before you execute the query. Alternatively,
you could wrap the
deletion in a transaction, and get user confirmation
before committing the
transaction. If you want to go that way, there are
several things to be
aware of. See the example of transactions in this article:
http://members.iinet.net.au/~allenbrowne/ser-37.html
message
Thanks for your help.
This has taken care of the action query but it has also
stopped the deletion warning, which is not what I would
like to happen. Maybe I am applying it wrong. I pasted
the
code you recomended after the line, On Error GoTo
Err_Re_Date_Click.
Can you please point me in the right direction?
Regards
Nick
-----Original Message-----
If this is an action query, you could suppress it with:
DoCmd.SetWarnings False
Don't forget to turn it back on again.
Unless there are parameters in the query, you could also
use:
dbEngine(0)(0).Execute "qyOrders-Update_tbOrders-
Temp-
Date",
dbFailOnError
That way you don't get any confirmation message, but you
do get to hear
about it if there is an error.
message
I have an Event Procedure below which works, however a
message box appears to confirm whether or not I want
to
carry out this action. Can anyone show me what code I
need
to use to suppress this message?
Assistance is greatly appreciated.
Nick
Private Sub Re_Date_Click()
On Error GoTo Err_Re_Date_Click
Dim stDocName As String
stDocName = "qyOrders-Update_tbOrders-Temp-Date"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Me![Orders-sub1].Requery
Exit_Re_Date_Click:
Exit Sub
Err_Re_Date_Click:
MsgBox Err.Description
Resume Exit_Re_Date_Click
End Sub