promting a command on closing a form

jaybo

Registered User.
Local time
Today, 14:00
Joined
Jun 15, 2005
Messages
16
I working on form that I would like to prompt the user if they would like to select close on a drop down box if another command is selected in another drop down box.

So when a user exit the form it asked if they would like to close the record ( select close on the drop down box)

Private Sub Command74_Click()

If Me.communication "Telephone"
then prompt message box "would you like to close this record" - yes or no

if Yes then

Status "Close"

DCmd.Close

End Sub

I would really appreciate help I still pretty new at VB
 
Code:
If Me.Communication = "Telephone" Then
    If MsgBox("Would you like to close this record?", vbQuestion + vbYesNo, "Close Record?") = vbYes Then
        Me.Status = "Close"
    Else
        MsgBox "user clicked no" 'just for testing
    End If
Else
    MsgBox "communication <> Telephone" 'just for testing
End If
 

Users who are viewing this thread

Back
Top Bottom