Hi Everyone
On a Continuous Form I have a Yes/No Control named "Marker"
What I need to happen is :-
If the Control is currently set as "Yes" and the user changes it to "No" Then Popup a MsgBox with the Message "Are you sure you want to change this to No?" with Buttons for Yes or Cancel
I have placed the following code in the Before Update of the Control:-
Code:
Private Sub PO_Schedule_Marker_BeforeUpdate(Cancel As Integer)
10 On Error GoTo PO_Schedule_Marker_BeforeUpdate_Error
Dim strMessage As String
Dim intResponse As Integer
20 If Me.PO_Schedule_Marker = False Then
' Display the custom dialog box.
30 strMessage = "Would you like to Change the current Marker to NO?"
40 intResponse = MsgBox(strMessage, vbYesNo + _
vbQuestion, _
"Continue Change?")
' Check the response.
50 If intResponse = vbYes Then
'.....
60 Else
70 Cancel = True
80 Me.PO_Schedule_Marker.SetFocus
90 End If
100 End If
110 Exit Sub
120 On Error GoTo 0
130 Exit Sub
PO_Schedule_Marker_BeforeUpdate_Error:
140 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure PO_Schedule_Marker_BeforeUpdate, line " & Erl & "."
End Sub
When I change the value to No I get the Popup Message as expected but when I click the No Button I get the following error:-
Any help in showing me where I am going wrong appreciated.