HOW TO TURN OFF VIOLATION ERROR WHE RUNNING A MACRO (1 Viewer)

lwarren1968

Registered User.
Local time
Yesterday, 19:38
Joined
Jan 18, 2013
Messages
77
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
 

June7

AWF VIP
Local time
Yesterday, 18:38
Joined
Mar 9, 2014
Messages
5,423
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:

oleronesoftwares

Passionate Learner
Local time
Yesterday, 19:38
Joined
Sep 22, 2014
Messages
1,159
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
 

June7

AWF VIP
Local time
Yesterday, 18:38
Joined
Mar 9, 2014
Messages
5,423
Good point. Why did warnings 'go away'?
 

Users who are viewing this thread

Top Bottom