Turn off SetWarnings before running the UPDATE and turn on SetWarnings after running the UPDATE. Can be done within macro.
Turn off SetWarnings before running the UPDATE and turn on SetWarnings after running the UPDATE. Can be done within macro.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
thanks, however, I am not seeing SetWarnings in the macro
Click "Show All Actions" on the Macro Tools tab.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
ok I had done that, but its not showing warnings
It does for me and should as well for Access 2010.
Why not use VBA?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
its an embedded macro on a command button. VBA shows this: Private Sub Command120_Click()
Does the embedded macro do anything besides call the VBA procedure? The VBA is where the UPDATE sql is? If you have so much VBA involved, why bother with macros?
Select [Event Procedure] in the event property and the VBA will execute without macro middleman. VBA can use the CurrentDb.Execute method and SetWarnings not needed.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
There is no VBA for the command button. It just runs the macro which is to Preview report and then remove records from checkbox once that is executed. I am not very good with writing VBA, that's why I am getting confused on this matter.
If there is no VBA, what does this mean "VBA shows this: Private Sub Command120_Click()"?
Don't know what else to tell you. I opened embedded macro in button click event, clicked "Show All Actions" and SetWarnings shows in the action list.
I would do VBA:
Private Sub Command120_Click()
DoCmd.OpenReport "report name here", acViewPreview
CurrentDb.Execute "UPDATE tablename Set fieldname=False"
End Sub
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I apologize, I did find SetWarnings in the macro and set it to "No". However, it shows a yellow exclamation next to it saying it will only execute if the database is trusted.
Because my users run only one database, we set up all Access installs to run any db without warning. Users don't have to 'enable' or 'trust' the db. I've never published a 'signed' database.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.