G
Guest
I would like to be able to click a button on a form, and make all the
controls that are check boxes TRUE (without having to know their names before
the code runs: that is, I know how to do Me.Chk1.value = true)
There's a line in the code below (written as pseudo code so you can
hopefully understand what I'm asking) that obviously doesn't work:
If the Control is a check box Then
Me.ctl.Properties ("Name").value = True
Any help is appreciated.
Private Sub cmdListProperties_Click()
ListControlProps Me
End Sub
Public Sub ListControlProps(ByRef frm As Form)
Dim ctl As Control
Dim prp As Property
On Error GoTo props_err
For Each ctl In frm.Controls
For Each prp In ctl.Properties
If the Control is a check box Then
Me.ctl.Properties ("Name").value = True
End If
Next prp
Next ctl
controls that are check boxes TRUE (without having to know their names before
the code runs: that is, I know how to do Me.Chk1.value = true)
There's a line in the code below (written as pseudo code so you can
hopefully understand what I'm asking) that obviously doesn't work:
If the Control is a check box Then
Me.ctl.Properties ("Name").value = True
Any help is appreciated.
Private Sub cmdListProperties_Click()
ListControlProps Me
End Sub
Public Sub ListControlProps(ByRef frm As Form)
Dim ctl As Control
Dim prp As Property
On Error GoTo props_err
For Each ctl In frm.Controls
For Each prp In ctl.Properties
If the Control is a check box Then
Me.ctl.Properties ("Name").value = True
End If
Next prp
Next ctl