I will try to provide you a solution for your current design, but your design makes no sense to me. In a database like a spreadsheet you normally do not run code to do a calculation and then save those values. You dynamically calculate your values for display. What you are doing in my mind would be equivalent to having a spread sheet where your fields do not have formulas in them. Instead you force the user to click a button and code runs sticking values in fields. That would not make much sense in a spread sheet, same for a database
There are many reasons for not saving calculated values. You can not ensure that your values are in fact "real time" based on additions, deletions, and edits of records. Further you are requiring a person triggered event procedure to do something that should just happen immediately. Like a spread sheet, you would want to see your values update as you change one of your x values and ensure they are 'real time'. You would not want to have to press a button to put hard-wired values into cells.
With that said, I will try to give you a solution for your current design. So you have a record with all the calculations already hardwired into fields. If I understand after you add a record (the "last Record") you want to do this
Update XCL column with XBARCL entry with the highest ID number.
Does this mean you want to change the field CL(X) for every record equal to XBARCL (20.58)? Or do you want to dynamically add a column called XCL equal to 20.58 for all records? Or something else?
If you want a new column for all records equal to XBARCL of the last entered record you can build a query like
Code:
SELECT
tblControlLimits.ID,
tblControlLimits.lotNumber,
tblControlLimits.X1,
.....
Other fields
(Select top 1 XBARCL from tblControlLimits order by ID DESC) AS LastCL
FROM tblControlLimits;
This adds a column called LastCL 20.58 to all records in a query.
That method is dynamic and does not persist.
If you want to insert 20.58 into all records in the CL(X) column then
you have to do that in two steps.
Build a simple query to get the last entered XBARCL. Call it
qryLastCL
Code:
SELECT TOP 1
tblControlLimits.XBARCL
FROM
tblControlLimits
ORDER BY
tblControlLimits.ID DESC;
Then call that query from another query
Code:
UPDATE
tblControlLimits,
qryLastCL
SET
tblControlLimits.[CL(X)] = [qryLastCL].[xbarcl];
Is that what you want?