HOW TO TURN OFF VIOLATION ERROR WHE RUNNING A MACRO

lwarren1968

Registered User.
Local time
Today, 08:00
Joined
Jan 18, 2013
Messages
78
I'm not sure what I'm missing here? I have a macro that should run 3 queries upon opening the database and all warning have gone away accept the Violation error. How can I get this warning to stop as well?


Option Compare Database

'------------------------------------------------------------
' AutoExec
'
'------------------------------------------------------------
Function AutoExec()
On Error GoTo AutoExec_Err

DoCmd.OpenQuery "MASTER VENDOR LIST_QRY", acViewNormal, acReadOnly
DoCmd.OpenQuery "MASTER INVOICE LIST_QRY", acViewNormal, acReadOnly
DoCmd.OpenQuery "INVOICE RECONCILATION_QRY", acViewNormal, acReadOnly


AutoExec_Exit:
Exit Function

AutoExec_Err:
MsgBox Error$
Resume AutoExec_Exit

End Function
 
Why are you opening queries? What do these queries do?

What is exact message of "violation" error?

Could try turning warnings off with SetWarnings action. Select "Show All Actions" on the macro design tab. Just be sure to turn them back on at end of macro.

But I am not sure that will stop a 'violation' error.
 
Last edited:
I'm not sure what I'm missing here? I have a macro that should run 3 queries upon opening the database and all warning have gone away accept the Violation error. How can I get this warning to stop as well?
I am more interested in all the warnings that have gone away, what did you do to make it go away, do same for the violation error, except if the violation error differs in design from the other warnings
 
Good point. Why did warnings 'go away'?
 

Users who are viewing this thread

Back
Top Bottom