I have a button on my main form that marks all controls in a continuous subform as "Yes", however it only changes the first record in the continuous form. The second, third, etc. records will not change. I found an answer using DAO recordsets but the comboboxes I'm using are unbound.
This is the code I have. It modifies all comboboxes in the first record in the subform.
For Each ctl In Me![SubformName].Controls
If ctl.ControlType = acComboBox Then
If ctl.Name <> "Yes" Then
ctl.Value = "Yes"
End If
End If
Next ctl
What do I change in my code to allow me to modify records past the first? Is there a way to directly refer to continuous form records?
Edited to add:
I still can't get it working for unbound comboboxes, but the following does work for bound ones.
Set rst = Me.SubformName.Form.RecordsetClone
rst.MoveFirst
Do While rst.EOF = False
rst.Edit
rst!FieldName = "Yes"
rst.Update
rst.MoveNext
Loop