Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Suppressing Warning Messages (2000)

    I have the below code. What I'm trying to do is run an update query after I click on a button. The query works correctly but I'd like to suppress the warning messages that come up. I can't figure it out. I'm pretty sure i'm using wrong code words or they are in the wrong place.
    Thanks,
    Deb
    Private Sub cmdPrint4172New_Click()
    On Error GoTo Err_cmdPrint4172New_Click

    Dim stDocName As String

    If Me.Dirty Then
    RunCommand acCmdSaveRecord
    End If

    If IsNull(Me.txtPRNo) Then
    MsgBox "There is no Purchase Request Number filled out for" & _
    " this Purchase Request. Please finish filling out the form" & _
    " and try again.", vbExclamation
    Me!txtPRNo.SetFocus

    Exit Sub
    End If

    stDocName = "rptPurchaseRequestFormNew"
    DoCmd.OpenReport stDocName, acPreview

    Showwarnings = False
    DoCmd.OpenQuery "qryComponentPartsVendorPRNew"
    showwarnings = True



    Exit_cmdPrint4172New_Click:
    Exit Sub

    Err_cmdPrint4172New_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrint4172New_Click

    End Sub

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Suppressing Warning Messages (2000)

    Hi Deb

    Change the following:

    Showwarnings = False
    DoCmd.OpenQuery "qryComponentPartsVendorPRNew"
    showwarnings = True

    to:

    DoCmd.SetWarnings = False
    DoCmd.OpenQuery "qryComponentPartsVendorPRNew"
    DoCmd.SetWarnings = True

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Suppressing Warning Messages (2000)

    patt,
    I had to take out the equal sign but that worked great. thank you very much.
    Deb

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Suppressing Warning Messages (2000)

    You are absolutely <img src=/S/blush.gif border=0 alt=blush width=15 height=15>, but aircode usually does that <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15>.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •