mercredi 22 novembre 2017

Access VBA Check if all Checkboxes are FALSE

Good afternoon all

I have this piece of code to check if the checkboxes of my form are not checked, but each time I have this error message: runtime error '438'

Private Sub Btn_Send_Click()
Dim ctl As Control
Dim iX As Integer

    For Each ctl In Me.Controls
        If TypeName(ctl) = "CheckBox" And ctl.Value = False Then iX = iX + 1
    Next ctl

If iX = 0 Then MsgBox "No checkBox Selected", vbExclamation, "Title"

End Sub

Debbuging error :

If TypeName(ctl) = "CheckBox" And ctl.Value = False Then

Run-Time Error #438: Object doesn't support this property or method

Thank you for your help




Aucun commentaire:

Enregistrer un commentaire