Hi,
Can anybody help me with this code. 2 checkboxes on form but can only select 1. Below is code for msgboxes everything works how I want but I get 2 msgboxes instead of 1.
Thanks
millrat
Private Sub Check339_BeforeUpdate(Cancel As Integer)
Dim StrMsg As String
StrMsg = "You can't select both checkboxes! Click OK to Cancel"
If Me.Check351.Value = True Then
MsgBox StrMsg, vbOKOnly, "Dual Selection"
If MsgBox(StrMsg, vbOKOnly, "Dual Selection") = vbOK Then
DoCmd.CancelEvent
Else
End If
End If
End Sub
Private Sub Check351_BeforeUpdate(Cancel As Integer)
Dim StrMsg As String
StrMsg = "You can't select two checkboxes! Click OK to Cancel"
If Me.Check339.Value = True Then
MsgBox StrMsg, vbOKOnly, "Dual Selection"
If MsgBox(StrMsg, vbOKOnly, "Dual Selection") = vbOK Then
DoCmd.CancelEvent
Else
End If
End If
End Sub
Can anybody help me with this code. 2 checkboxes on form but can only select 1. Below is code for msgboxes everything works how I want but I get 2 msgboxes instead of 1.
Thanks
millrat
Private Sub Check339_BeforeUpdate(Cancel As Integer)
Dim StrMsg As String
StrMsg = "You can't select both checkboxes! Click OK to Cancel"
If Me.Check351.Value = True Then
MsgBox StrMsg, vbOKOnly, "Dual Selection"
If MsgBox(StrMsg, vbOKOnly, "Dual Selection") = vbOK Then
DoCmd.CancelEvent
Else
End If
End If
End Sub
Private Sub Check351_BeforeUpdate(Cancel As Integer)
Dim StrMsg As String
StrMsg = "You can't select two checkboxes! Click OK to Cancel"
If Me.Check339.Value = True Then
MsgBox StrMsg, vbOKOnly, "Dual Selection"
If MsgBox(StrMsg, vbOKOnly, "Dual Selection") = vbOK Then
DoCmd.CancelEvent
Else
End If
End If
End Sub