Passing a single row to a fonction

inoxo

Registered User.
Local time
Today, 02:34
Joined
Sep 8, 2005
Messages
42
Hello,

I have a table on which i must work at row level, one by one.
I put the table into a recordset and i scroll the table row by row from the top until the bottom. The work process - a test - is executed for each row and returns an integer.
I would like to put the process into a function and simply call the function when i move to the next row.

I defined : Function TestScore(ByVal MyTable as Recordset) as Byte

As it is so slow and the results are not always correct, I wonder if the WHOLE table might be passed to the function, and not only the current row.

Does anyone has an idea on passing a single row from a recordset to a function ?

Thanks
 
To begin with, you are using "spreadsheet" logic.

In a query, you can put any function you want and it is automatically done per-record. If you have a computation that is row-specific, you can include a function in a query to do this. If you have a computation that is COLUMN-specific, you need to use an AGGREGATE query to get the job done.

While you don't actually describe it in detail, it is possible that you are ALSO violating normalization given what you described. If the row is a set of test scores for a single test, you are thinking "spreadsheet" that way, too.

Just remember that sometimes Access excels in recordkeeping - but sometimes you have better access to results through Excel. Just don't ask Excel to do Access's work and vice-versa. Each has its purpose. If this is a school assignment, I STRONGLY urge you to read up on "Normalization." If this is something to help you do your job, instead consider using features of Excel to "Git-R-Done."
 

Users who are viewing this thread

Back
Top Bottom