Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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.

  2. #17
    mike23 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2014
    Posts
    16
    thanks, however, I am not seeing SetWarnings in the macro

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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.

  4. #19
    mike23 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2014
    Posts
    16
    ok I had done that, but its not showing warnings

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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.

  6. #21
    mike23 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2014
    Posts
    16
    its an embedded macro on a command button. VBA shows this: Private Sub Command120_Click()

  7. #22
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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.

  8. #23
    mike23 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2014
    Posts
    16
    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.

  9. #24
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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.

  10. #25
    mike23 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2014
    Posts
    16
    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.

  11. #26
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Batch import
    By brandonze in forum Programming
    Replies: 6
    Last Post: 03-24-2011, 10:13 AM
  2. Batch Import and Update from DBF
    By Lady_Jane in forum Import/Export Data
    Replies: 7
    Last Post: 02-08-2011, 02:57 PM
  3. Run batch file
    By shay in forum Access
    Replies: 3
    Last Post: 12-15-2010, 09:47 AM
  4. Batch Update
    By Tyork in forum Programming
    Replies: 2
    Last Post: 11-15-2010, 05:33 PM
  5. Batch import .txt
    By hchui in forum Import/Export Data
    Replies: 1
    Last Post: 10-14-2010, 08:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums