Find difference between two fields

gwunta

Access Junkie
Local time
Today, 02:16
Joined
May 1, 2001
Messages
24
I have a table which has two records in it and 5 numerical fields. I need to divide each field of one record by the corresponding field of the next record. If the result is greater than a set value then other code will follow. I have tried creating two tables each with one record and then using the following code to create the difference

If (Tables![tblWeekPrior]![Entry 1] / Tables![tblFortnightPrior]![Entry 1]) > 1.23 Then

but this is not working. Both tables are open when this code executes. Please help.
 
You are already using code so instead, create a recordset based on the table and do your calculations within the recordset. If you are not sure how to do this, post your data and I'll give you an example.
 

Users who are viewing this thread

Back
Top Bottom