Close Msgbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm a VBA beginner and in the BeforeUpdate event, I'd like a msgbox to appear
that asks the following question. I'm not sure how to write, in the code,
that if a user clicks "yes" I want the msgbox to close and the record to
continue saving. If the user clicks "no" I want the msgbox to close and the
record to remain open for viewing. Thanks -


Dim Response as Integer
Response = MsgBox("Have you verified that Robot or Manual is selected for
every completed Location?" _
& "Click 'Yes' if you are certain and want to
continue saving this record " _
& "or click " _
& "'No' to close this window and view the record.")
If Response = vbYes Then
Else
 
Perfect! Thank you so much -

Lynn Trapp said:
Try this:

If MsgBox("Have you verified that Robot or Manual is selected for
every completed Location?" _
& "Click 'Yes' if you are certain and want to
continue saving this record " _
& "or click " _
& "'No' to close this window and view the
record.",vbYesNo) = vbNo Then
Cancel = True
End If



--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html
 
Back
Top