checkbox control array

  • Thread starter Thread starter mcnews
  • Start date Start date
M

mcnews

how can i make this work for checkboxes?

Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then ctl = Null
'If ctl.ControlType = acCheckBox Then ctl = False
Next
 
If ctl.ControlType = acCheckBox Then ctl = False

should work just fine. What error are you getting?
 
If ctl.ControlType = acCheckBox Then ctl = False

should work just fine. What error are you getting?

this appears to work (4 is DefaultValue):

For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then ctl = Null
If ctl.ControlType = acCheckBox Then
If Not IsNull(ctl) Then ctl.Properties(4).Value = Null
End If
Next
 
this appears to work (4 is DefaultValue):

For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then ctl = Null
If ctl.ControlType = acCheckBox Then
If Not IsNull(ctl) Then ctl.Properties(4).Value = Null
End If
Next

this works too:

If ctl.ControlType = acCheckBox Then ctl.Value = Null
 
This shouldn't make any difference:

If ctl.ControlType = acCheckBox Then ctl.Value = False
or
If ctl.ControlType = acCheckBox Then ctl = False

The value property is the default property of the check box. Null is not the
same as False. You will notice that the value of the check box in unbound
check boxes gray's out, while bound check boxes will become clear.
 
This shouldn't make any difference:

If ctl.ControlType = acCheckBox Then ctl.Value = False
or
If ctl.ControlType = acCheckBox Then ctl = False

The value property is the default property of the check box. Null is not the
same as False. You will notice that the value of the check box in unbound
check boxes gray's out, while bound check boxes will become clear.

it wouldn't let me assign any value without the .value.
 
Back
Top