Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004

    Unanswered: create pop up message

    I have an access front. One button named delete, i would like to have a pop up box that display message: Are you sure you want to delete? to make sure the user really want to delete the record. How could finish this in property? Thanks.

  2. #2
    Join Date
    Nov 2003
    Chances are (by the sound of it) you used the Button Wizard to provide a Delete Record button on your Form. In the OnClick event (via the VBE) for the Command Button you can see all the code that was placed there by the wizard.....Because you didn't provide the underlying code for your command button then If you dare, delete it and try this:

    Private Sub myCommandButton_Click()
       On Error Goto myCommandButton_Error
       If MsgBox("Delete Current Record..." & vbCrLf & vbCrLf & "Are you sure you want " & _
                 "to Delete this Record?", vbExclamation + vbYesNo, _
                 "Delete Record...") = vbYes Then
          DoCmd.SetWarnings False
          DoCmd.RunCommand acCmdDeleteRecord
          DoCmd.SetWarnings True
        End If
        Exit Sub
        MsgBox Err.Description   
        Resume myCommandButton_Exit   
    End Sub
    Change the items in Red to reflect the name of your Command Button.

    Self Taught In ALL Environments.....And It Shows!

  3. #3
    Join Date
    Mar 2004
    Thanks a lot. It works.

Posting Permissions

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