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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 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

16 Experts available now in Live!

Get 1:1 Help Now