How do I stop the message box warnings issued whenever I run an action query with DoCmd RunSQL or DoCmd OpenQuery or from a macro?
A In a macro, SetWarnings: Off In Code, “DoCmd SetWarnings False”. It’s worth noting that you should turn the warnings back on afterwards as this applies to just about everything, even saving a form in design mode so it won’t let you abandon it if you wanted to. Another thing in Code, you can use the .Execute method on a QueryDef object or DataBase Object, this has the advantages of being able to run inside a transaction and so execute faster, “DoCmd” starts another session of Jet (the database engine in Access) so will execute outside of the current default workspace, therefore running independantly of any transactions and you can’t rollback from them. Updated: 21/07/1996 – Trevor Best Back to Top Q How can I generate a sequence of numbers (like record numbers) in a query. Back to Top A In a module: (declarations) Option Explicit Dim mlngCounter As Long Function ResetCounter() mlngCounter = 0 End Function Function GetNextCounter(pvar As Variant) As Long mlngCounter = mlngCounter + 1 G
Related Questions
- How do I stop the message box warnings issued whenever I run an action query with DoCmd RunSQL or DoCmd OpenQuery or from a macro?
- Can we run automated programmes with the full version,i.e. Will the message boxes requesting user action disappear?
- Is it possible to show a message box to the user while the user tries to run a blocked application?