Unable to select control after event cancelled

kroeger

Registered User.
Local time
Today, 08:11
Joined
Apr 13, 2014
Messages
39
Hi,

I have validation on a checkbox on a sub form and after the validation fails and the cancel = true is executed in the before update event, I am unable to select the checkbox on the form. Access will not allow the selection. Any ideas would be appreciated. Hope this is the right forum. my subform is called frmContactType so hopefully I am referencing it correctly:

Me.frmContactType.Form.chkAssociate
 
here you go:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If (Me.frmContactType.Form.chkAssociate = 0) Then
MsgBox "Please select associate"
Cancel = True
End If
End Sub

I also get a dialog of you can't go to specified record
 
Try this,
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
    If (Me[COLOR=Red][B]![/B][/COLOR]frmContactType.Form[COLOR=Red][B]![/B][/COLOR]chkAssociate = 0) Then
        MsgBox "Please select associate"
        Cancel = True
    End If
End Sub
 
Sorry it does not work. As soon as I dismiss the messagebox and try to click the check box nothing happens. Is it because the subform is really a representation of the underlying table? I have not added the checkbox to the subform it is visible as a check box because the table field is a yes/no field.
 

Users who are viewing this thread

Back
Top Bottom