Getting rid of warning messages for delete queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stevestan1
    New Member
    • Aug 2010
    • 27

    #1

    Getting rid of warning messages for delete queries

    I have a delete query I linked to in a form. Everytime I click on the link, I get two warning messages about using the delete query. The first is "Are you sure you want to run this delete query" and the second is "You are about to delete XXX number of lines." Is there any way to eliminate these warning messages? Thanks.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    You can either use these lines around your code :
    Code:
    Call DoCmd.SetWarnings(False)
    Call DoCmd.RunSQL(...)
    Call DoCmd.SetWarnings(True)
    or, alternatively, use the .Execute method of the database instead :
    Code:
    Call CurrentDB.Execute(strSQL)

    Comment

    • Stevestan1
      New Member
      • Aug 2010
      • 27

      #3
      Thanks, the code took out the messages

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        I'm pleased that helped :)

        Comment

        Working...