Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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?

0
Posted

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?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123