how to "select all" filtered recordset????

  • Thread starter Thread starter GSteven
  • Start date Start date
G

GSteven

I've created a continuous form which is based on a straightforward table
(ex - customers - 100 records). On the form there is a checkbox with a
control source named "MARK" (boolean) from customer table. I can check and
uncheck individual records fine. Then I created 2 command buttons named
"Select All" and "Deselect All". The Onclick property of these buttons runs
code which calls an update query. All works as expected except that I wanted
to be able to select or deselect a filtered view of the records.

When I apply a filter and select all, ALL records are selected instead of
just the records as viewed in the filtered set. Any way to improve upon
this?

tia
Steve
 
There are a couple of ways I can think of. Which you use will depend on your
VBA skills and preferences.

The least coding method would be to copy your update query to a new query
and add the filter critera that matches the filtering you are using on the
form. You would need a query for each filter option. Then, in your command
button code, you can execute the correct query based on the form's Filter
property.

The other solution would be to convert the stored query to an SQL string and
modify it programmatically based on the form's Filter Property.
 
Back
Top