Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing all records in a continuous form

Status
Not open for further replies.

ghacig

Technical User
Sep 24, 2004
60
US
I have a continuous form that is based on a filtered table. Each record in the form contains a check box that is bound to a field in the table. I would like to have an unbound checkbox in the header of the form. When I check the header checkbox, I want the checkboxes in all the records of the continuous form to also change. The question is, can I do that with code applying to the form itself, or do I need code that changes the value of the checkboxes directly in the table?

I would appreciate any help. Thanks.
 
You could go either way. Normally I would run an update query or use the forms recordset. But if you wanted to you could loop the form itself.

Something like this

Code:
dim rs as dao.recordset
set rs = me.recordset
rs.movefirst
do while not rs.eof
  rs.edit
   rs!somefieldName = true
  rs.update
  rs.movenext
loop
If you want to check/uncheck them all also you probably could change to
rs!somefieldName = me.yourUnboundCheckBoxName.value
 
Thank you so much and sorry for the delay. It worked very nicely!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top