MacroScope
Programmer
I have built a calculator using unbound controls on a form in Access that functions very much like a dynamic Excel spreadsheet. Changing a value results in an instantaneous recalculation of other values that are dependent on that input. The one calculation that eludes me is the one that outputs the heat capacity of water at a given temperature and pressure. It is a highly complex calculation, and the resultant output is critical to my final calculations.
I was fortunate enough to find online exactly such a calculator in VBA as an add-in for Excel, and it works perfectly there. I have attached an Excel spreadsheet that has the two input fields and the calculated output field so you can see it in operation. The VBA code which controls it is visible by hitting ALT+F11 while viewing the spreadsheet.
I'm trying to migrate the calculation called cpW() from Excel VBA to my Access calculator and I'm having a devil of a time with it. I'm hoping that one of the resident code whizzes here can look at it and help me successfully conclude that migration.
My Access field that is equivalent to Excel temperature B1 (in degrees C) is called [BTemp], and the field that is equivalent to Excel pressure B2 is my [Depth] field /10, since pressure in bar is equivalent to depth in meters /10. If anyone can create a three field Access form with two unbound controls, [BTemp] and [Depth] as inputs and the third, called [HeatCap], as the calculated heat capacity result just the way the Excel sheet does I would be greatly appreciative. The answers are there in front of me but I just don't know how to put it together.
Thanks to all in advance.
I was fortunate enough to find online exactly such a calculator in VBA as an add-in for Excel, and it works perfectly there. I have attached an Excel spreadsheet that has the two input fields and the calculated output field so you can see it in operation. The VBA code which controls it is visible by hitting ALT+F11 while viewing the spreadsheet.
I'm trying to migrate the calculation called cpW() from Excel VBA to my Access calculator and I'm having a devil of a time with it. I'm hoping that one of the resident code whizzes here can look at it and help me successfully conclude that migration.
My Access field that is equivalent to Excel temperature B1 (in degrees C) is called [BTemp], and the field that is equivalent to Excel pressure B2 is my [Depth] field /10, since pressure in bar is equivalent to depth in meters /10. If anyone can create a three field Access form with two unbound controls, [BTemp] and [Depth] as inputs and the third, called [HeatCap], as the calculated heat capacity result just the way the Excel sheet does I would be greatly appreciative. The answers are there in front of me but I just don't know how to put it together.
Thanks to all in advance.