Hi, when i tick a checkbox i got the msgbox popup twice
Checkbox CODE
Function CODE
Tried to fix like this as recommended in my last post but it didn't work
Checkbox CODE
VBA Code:
Private Sub CheckBox3_Click()
If Prev(chk) = "NO1" Then
chk.Object = False
Exit Sub
End If
End Sub
Function CODE
VBA Code:
Function Prev(chk As OLEObject)
Dim PrevValue As Variant
If TypeName(chk.Object) = "CheckBox" Then
PrevValue = chk.TopLeftCell.Offset(-1, 0).Value
If PrevValue = "0" Then
chk.TopLeftCell.Offset(0, 0).Value = "0"
chk.Object = False
MsgBox "Not correct"
Prev = "NO1"
Else
chk.TopLeftCell.Offset(0, 0).Value = "1"
End If
End If
End Function
Tried to fix like this as recommended in my last post but it didn't work
VBA Code:
Dim runChkBox As Boolean
Private Sub CheckBox3_Click()
Dim chk As OLEObject
Set chk = Me.OLEObjects(CheckBox3.Name)
If runChkBox Then
runChkBox = False
Exit Sub
End If
If Prev(chk) = "NO1" Then
runChkBox = True
chk.Object = False
Exit Sub
End If
End Sub