I have a checkbox on my form that basically deletes a record when the user ticks the checkbox. What I want to know is how do i check whether the person is "ticking" or "unticking" a checkbox before any action is carried out?
Use the BeforeUpdate event instead of AfterUpdate.
Code:
Private Sub checkBoxName_BeforeUpdate(Cancel As Integer)
If MsgBox("Are you sure you want to " & IIF(Me.checkBoxName = True, "Tick", "Untick") & " the checkbox?", vbYesNo) = vbNo Then
Cancel = True
End If
End Sub