A filtered subform

A

Andy Levy

Hi

I have a Continuous Record subform in Datasheet View. This subform can be
filtered using accesses filtering, by right clicking etc..

What i would like to do is perform a task on all the filtered records in
that subform.

For example :
I have a tick box as a field in the subform, and a button on the Master Form
called 'Tick All'. If the user clicks this button then all the filtered
records on the subform should be ticked and all records outside of the
filter should remain as they were.

I cant seem to find a way to do this.
 
A

Andy Levy

Just to let you know - ive sorted it . This is how..

I got confused because what i am accessing is a Control inside a Form inside
a Control which is inside a Form.
You can probably see why i got confused.

Andrew


Private Sub setClear_Click()
Dim frm As Form
Set frm = Me.Form

Dim ctl As Control
Set ctl = frm.stockReport_subform1

ctl.Form.Recordset.MoveFirst
Dim counter As Integer

For counter = 0 To ctl.Form.Recordset.RecordCount - 1
ctl.Form.Recordset.Edit
ctl.Form.Recordset.[Report Select].value = False
ctl.Form.Recordset.Update
ctl.Form.Recordset.MoveNext
Next counter

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top