Pop up yes/no response box

reeve13

Registered User.
Local time
Yesterday, 22:42
Joined
Nov 1, 2005
Messages
24
I have a database which tracks onsite and offsite files. I need to create a pop up message box using the toggle button function, with a "yes" or "no" response, so when a file is onsite and you click the offsite box, a pop up message box will display the following message, "Are you sure you want this file offsite?" and if yes is clicked, it will switch to the offsite field. If no is clicked, it stay as is, (onsite would be the default). The same thing applies for when a file is offsite and you want to return it onsite, when you click in the onsite box, the pop up message box would display "Are you sure you want this file onsite" if yes is clicked, it will switch to yes, and if no is clicked, it stay as is. Can this be done?

Thanks!
 
In the toggle button BeforeUpdate() event call the MsgBox function (with appropriate parameters-vbYesNo + string "Are you sure..." etc.)
if vbNo is selected - exit Subroutine eg.

Private Sub Toggle0_BeforeUpdate(Cancel As Integer)
Dim nResponse As Integer

nResponse = MsgBox("Are you sure?", vbYesNo+vbQuestion,"Question")
If nResponse = vbNo Then
Cancel = True
Exit Sub
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom