Perform Action Only on Filtered Records

L

LarryP

I have a form with a subform: parent records in the form, related child
records in the subform. The user can filter the subform data with the
built-in Access filtering functionality.

I also have a button on the subform that sets a "batch flag" checkbox on the
subform (actually, performs an SQL update of the field in the underlying
table). Problem is, when the user filters down the subform data from 100
records to the 10 he's really interested in, the button still flags ALL the
records, not just the ones that survived the filtering process. Could use
some sample code or other hints on the easiest way to flag only the filtered
records.
 
J

Jeanette Cunningham

Hi Larry,
Instead of using the built-in filter in access, filter the subform by
setting its recordsource using criteria in the Where clause.
Use the same criteria in the SQL that updates the underlying table field.

Jeanette Cunningham
 

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