Use VBA to Update All on Filtered Form

Posted on 2011-02-27
Last Modified: 2012-05-11

Take a simple table with 5,000 records;

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.

Question by:Patrick O'Dea
  • 3
LVL 119

Expert Comment

by:Rey Obrero
ID: 34991972

with me.recordset
end with
LVL 119

Accepted Solution

Rey Obrero earned 500 total points
ID: 34991980

with me.recordset
    do until .eof
end with
LVL 119

Expert Comment

by:Rey Obrero
ID: 34992002
you have to run the codes after applying your filter..

Author Closing Comment

by:Patrick O'Dea
ID: 34992027
Thanks, Perfect!

An elegant solution.
I have never used recordsets before.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now