I have figured out how to loop through the recordset, but I cannot seem to isolate the checkbox in each row of the form and set its value to either True or False. I have tried it four different ways (one at a time). I have included all four examples below. I would appreciate any help that I can get.
Expand|Select|Wrap|Line Numbers
- Dim tmpcontrol As Controls
- Dim bSelectAll As Boolean
- bSelectAll = Me.SelectAll.Value ‘Checkbox in the Form Header
- For indx = 0 To (Me.Form.Recordset.RecordCount - 1)
- ‘Attempt 1
- Me.Select.OptionValue = bSelectAll
- ‘Attempt 2
- Me.Select(indx).Value = bSelectAll
- ‘Attempt 3
- For Each tmpcontrol In [CourseInfoForm].Form.Controls
- If tmpcontrol.ControlType = acCheckBox Then
- tmpcontrol.Value = bSelectAll
- End If
- Next tmpcontrol
- ‘Attempt 4
- For Each tmpcontrol In [CourseInfoForm].Form.Controls
- If tmpcontrol.Name = "Select" Then
- tmpcontrol.Value = bSelectAll
- End If
- Next tmpcontrol
- Next
Mark