my first post (or at least my first in a long while), and a bit of a virgin in vba code!
I have three tables tblAlmPhilosophy, tblAlmRationalization, tblPointAnalog. Within tblAlmRationalization I have a field 'fldRecHighDeadband' (integer) that I need to automatically populate for each fldPTName (string) record by examining other record fields within tblAlmPhilosophy and tblAlmRationalization. (fldPTName is common between tblAlmRationalization and tblPointAnalog)
tblAlmPhilosophy is a definition table and contains fldFlow1 (string) and fldPrs1 (string), together with fldFlow1DB (integer) and fldPrs1DB (integer). tblPointAnalog contains fldPTName and fldENGUNITS (string).
I believe I need to lookup the fldPTName from tblAlmRationaization within tblPointAnalog to obtain the value of fldENGUNITS, then...
if fldENGUNITS = fldFLow1, then fldRecHighDeadband = fldFlow1DB
if fldENGUNITS = fldPrs1, then fldRecHighDeadband = fldPrs1DB
How do I pull data from these two tables to calculate fldRecHighDeadband :banghead:?
I was assuming I'd have to assign each table a variable name, a variable for each field of each table, but then I wasn't sure if a loop was needed to cycle through each record field (I don't know how to do loops in vba).
I was going to activate the calculation through a button for 'initiate'.
Once I have the fldRecHighDeadband I'll then need to pull fldMin (integer) and fldMax (integer) from tblPointAnalog and multiply fldRecHighDeadband by fldMin and fldMax to calculate two more fields in tblAlmRationalization; fldRecHighDBMin (integer) and fldRecHighDBMax (integer)
your input with code is much appreciated - thanks in advance!
I have three tables tblAlmPhilosophy, tblAlmRationalization, tblPointAnalog. Within tblAlmRationalization I have a field 'fldRecHighDeadband' (integer) that I need to automatically populate for each fldPTName (string) record by examining other record fields within tblAlmPhilosophy and tblAlmRationalization. (fldPTName is common between tblAlmRationalization and tblPointAnalog)
tblAlmPhilosophy is a definition table and contains fldFlow1 (string) and fldPrs1 (string), together with fldFlow1DB (integer) and fldPrs1DB (integer). tblPointAnalog contains fldPTName and fldENGUNITS (string).
I believe I need to lookup the fldPTName from tblAlmRationaization within tblPointAnalog to obtain the value of fldENGUNITS, then...
if fldENGUNITS = fldFLow1, then fldRecHighDeadband = fldFlow1DB
if fldENGUNITS = fldPrs1, then fldRecHighDeadband = fldPrs1DB
How do I pull data from these two tables to calculate fldRecHighDeadband :banghead:?
I was assuming I'd have to assign each table a variable name, a variable for each field of each table, but then I wasn't sure if a loop was needed to cycle through each record field (I don't know how to do loops in vba).
I was going to activate the calculation through a button for 'initiate'.
Once I have the fldRecHighDeadband I'll then need to pull fldMin (integer) and fldMax (integer) from tblPointAnalog and multiply fldRecHighDeadband by fldMin and fldMax to calculate two more fields in tblAlmRationalization; fldRecHighDBMin (integer) and fldRecHighDBMax (integer)
your input with code is much appreciated - thanks in advance!
Last edited: