Link to home
Start Free TrialLog in
Avatar of Patrick O'Dea
Patrick O'DeaFlag for Ireland

asked on

Use VBA to Update All on Filtered Form

Hi,

Take a simple table with 5,000 records;
Product
Supplier
Area
Price

I have a continuous form which display these 4 fields.
I will use the standard "filter" facilities to restrict which records are displayed.

My Requirement: When I click on a button how do I set the [Price] field to zero for the records that are filtered.

I guess, the key thing here is how do I process my update on ONLY the filtered records.

Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image


with me.recordset
     .edit
     !price=0
     .update
end with
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you have to run the codes after applying your filter..
Avatar of Patrick O'Dea

ASKER

Thanks, Perfect!

An elegant solution.
I have never used recordsets before.