Any Access nutters know much about filters & code

paulmcdonnell

Ready to Help
Local time
Today, 10:10
Joined
Apr 11, 2001
Messages
167
Hi to all Access Nuts
What I'm trying to do is allow the user to aplly a filter on a form to reduce the amount of entries to relevant companies.

Then I want them to be able to loop through the selection and update a field in the releveant comapanies.

Now, I know how I can loop through the underlying query and update records, but how do i get my update code to loop through the filtered displayed data rather than the underlying query?

Does anyone know how I link the selected filter to the code so it only updates the filter results......?


Hope you guys can help..

Cheers
Paul
 
Not tested but I wonder if me.recordsetclone would not return the filtered subset of data you want?

Alex
 
My guess is to do it using a recordset.

A filter is simply a WHERE statement, so build up a select statement to define your Recordset
e.g. strSQL="SELECT Make FROM Cars WHERE " & Forms!frmCars.Filter

then open your recordset

CarRecord.Open strSQL, db, adOpenKeyset, adLockOptimistic

and do whatever you need to do to the records that have been selected using the filter
 

Users who are viewing this thread

Back
Top Bottom