Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Warning Massage

Discussion in 'Information Technology' started by Tom, Jul 28, 2006.

  1. Tom

    Tom
    Expand Collapse
    Guest

    Hi All,

    Here is what I wrote:

    Dim Msg As String, Style, Title, Response
    Msg = "You are about to delete this record from the list, continue?"
    Style = vbOKCancel
    Title = "Delete Record"
    Response = MsgBox(Msg, Style, Title)
    If Response = vbOK Then
    DoCmd.RunCommand acCmdDeleteRecord
    DoCmd.SetWarnings False
    End If
    and still I get access massage that I`m about to delete a record.

    Thnaks,
    Tom
     
  2. Loading...

    Similar Threads Forum Date
    UK Summer Warnings over Forced Marriages Breaking News Aug 10, 2013
    Canada Warning: your Internet may not work on Monday Breaking News Jul 7, 2012
    World UNHCR in Somalia 'Human Tragedy' Warning Breaking News Jul 6, 2011
    WARNING: Facebook, PayPal logins released by hackers Information Technology Jun 18, 2011
    India Ramdev Threatens Armed Rebellion, Govt Issues Stern Warning Breaking News Jun 8, 2011

  3. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Tom,

    You've got the SetWarnings in the wrong place. I would do it like this...

    If MsgBox("You are about to delete this record from the list,
    continue?", vbYesNo, "Delete Record") = vbYes Then
    DoCmd.SetWarnings False
    DoCmd.RunCommand acCmdDeleteRecord
    DoCmd.SetWarnings True
    End If

    --
    Steve Schapel, Microsoft Access MVP


    Tom wrote:
    > Hi All,
    >
    > Here is what I wrote:
    >
    > Dim Msg As String, Style, Title, Response
    > Msg = "You are about to delete this record from the list, continue?"
    > Style = vbOKCancel
    > Title = "Delete Record"
    > Response = MsgBox(Msg, Style, Title)
    > If Response = vbOK Then
    > DoCmd.RunCommand acCmdDeleteRecord
    > DoCmd.SetWarnings False
    > End If
    > and still I get access massage that I`m about to delete a record.
    >
    > Thnaks,
    > Tom
    >
    >
    >
    >
     
  4. Tom

    Tom
    Expand Collapse
    Guest

    ooops, Thanks

    "Steve Schapel" <schapel@mvps.org.ns> wrote in message
    news:unRP%23JldGHA.1320@TK2MSFTNGP04.phx.gbl...
    > Tom,
    >
    > You've got the SetWarnings in the wrong place. I would do it like this...
    >
    > If MsgBox("You are about to delete this record from the list, continue?",
    > vbYesNo, "Delete Record") = vbYes Then
    > DoCmd.SetWarnings False
    > DoCmd.RunCommand acCmdDeleteRecord
    > DoCmd.SetWarnings True
    > End If
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    >
    > Tom wrote:
    >> Hi All,
    >>
    >> Here is what I wrote:
    >>
    >> Dim Msg As String, Style, Title, Response
    >> Msg = "You are about to delete this record from the list, continue?"
    >> Style = vbOKCancel
    >> Title = "Delete Record"
    >> Response = MsgBox(Msg, Style, Title)
    >> If Response = vbOK Then
    >> DoCmd.RunCommand acCmdDeleteRecord
    >> DoCmd.SetWarnings False
    >> End If
    >> and still I get access massage that I`m about to delete a record.
    >>
    >> Thnaks,
    >> Tom
    >>
    >>
     

Share This Page