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!

Looping through subform records in code? 1

Status
Not open for further replies.

markgx

IS-IT--Management
Nov 27, 2002
3
GB
I have a datasheet subform on a main form. The subform records have tick box fields. When a subform tickbox is ticked, (the on click event), I want to check all other records in the subform to see if all tick boxes have been ticked, and then update the main form header record accordingly. I am using Access 2002 and ADO 2.1

Thanks Mark Greatorex
 
Hi

In the after update event of the tickbox control on the subform

Dim Rs as ADODB.Recordset

If chkBox = True Then
Set Rs = Me.RecordsetClone
Do Until Rs.EOF
' do your checking here
Rs.MoveNExt
Loop
Rs.Close
Set Rs = Nothing
End if Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks,
My problem seemd to be that I didn't know what to define the record set as - DAO ADO etc.

The line
dim rs asADODB.Recordset
was the important one.

Thanks
Mark.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top