I have created a form to create new logistics requests. I want the system to prompt when the form is closed to ask whether or not saving is required. I have tried to create a macro but it still does not ask a question.
Hi Dilly, try the following in the BeforeUpdate event of your form (obviously, you can enter whaterver text you want between the quotes):
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim msg, style, title, response
msg = ("Do you want to save this request?"
style = vbYesNo + vbQuestion
title = "Save Request?"
response = MsgBox(msg, style, title)
If response = vbNo Then
Me.Undo
Else
Exit Sub
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.