You could loop through all of the controls something like:
Code:for each x in me.controls if isSomething(x) then ''Do something end if next
joh024,
Am I missing something with your code? How will your code handle multi records in a filtered sub form?
It seemed to me that the OP wanted to manipulate the controls on a subform as the records changed. So I was saying that the controls could be changed based on some criteria as the records change. The question was really general so I gave a general type of answer.
You could loop through all of the controls something like:
Code:for each x in me.controls if isSomething(x) then ''Do something end if next
How would I use that?, on The button_Click() ???
Supposing my checkbox column is chkbox2
and my subform is "subfrm2"
How would I do it? :S
If you would like to control the subform through a button click then yes use the button_click event. Then if you only want to change one control like chkBox2 then you don't need the loop. Just set chkBox2.value = true or false depending on what you want to do.
UPDATE Mysubform SET ColumnID=MyValue
Is thatthe UPDAT E you are talking about right?
Would that update all the filtered records on the subform?
UPDATE Mysubform SET ColumnID=MyValue [b]Where[/b] MyField = MyValue2
set rst=currentdb.openrecordset(your record source)
while not rst.eof
if rst!whateverfield = whateversetting then do something
rst.movenext
wend
you could process the recordset but thats code
Code:set rst=currentdb.openrecordset(your record source) while not rst.eof if rst!whateverfield = whateversetting then do something rst.movenext wend