Re: How to run VBA code on all rows of a table
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Wed, 4 Jun 2008 15:42:27 -0400
"Jimbo213" <Jimbo213@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1677F00A-7206-4CD9-8E25-78844CC1BC4D@xxxxxxxxxxxxxxxx
"Klatuu" wrote:
Tell me a bit about the scoring?
Here is a simplified example [where F# is the field number in a record]
if F1 & F2 & F3 meet certain rules then ScoreA = computed value A
if F4 & F5 & F6 meet certain rules then ScoreB = computed value B
if F7 & F8 & F9 meet certain rules then ScoreC = computed value C
OverallScore = (ScoreA + ScoreB + ScoreC)/3
I have a button that computes this for every row I'm on.
I have 250 rows in my master table.
I'd like to have some sort of looping code or macro that would essentially
"press the button" from the first row to the last row
This is actually one case where simplifying may not have helped. <g>
On the face of it, it looks as though you should be able to use an Update
query (or perhaps three Update queries), rather than looping through a
recordset using VBA. It's almost always better to use SQL than looping. Of
course, it's possible that your actual calculations don't lend themselves to
using SQL.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
.
- Follow-Ups:
- Re: How to run VBA code on all rows of a table
- From: Jimbo213
- Re: How to run VBA code on all rows of a table
- Prev by Date: Re: Transfering Data
- Next by Date: RE: One to many OR one to one with same data
- Previous by thread: Re: How to run VBA code on all rows of a table
- Next by thread: Re: How to run VBA code on all rows of a table
- Index(es):
Loading