D
DubboPete
Hi all,
I have three fields on a form. Dose1, Calc1 and Calc2.
Dose1 will be the field into which a numerical entry will be made, and
this entry will always be an even number. It's based around a
prescription drug which comes in either 8mg tablets or 2mg tablets,
and a combination of both tablets can be used to make up a dose.
Example: a 22mg prescription dose would consist of 2 x 8mg tablets
(16mg), pls 3 x 2mg tablets (6mg), that's 5 tablets in all amounting
to 22mg. I'd like to know how to calculate the following:
If Dose1 = 22 then Calc1 should be 22 divided by 8 (as a whole number
rounded down) = 2
If Calc1 is 2, then Calc2 should be (Dose1 (22) minus Calc1 (2x8))
divided by 2 = 3
(Dose1-Calc1)/2
'or'
8 goes into 22 twice, with the remainder of 6, so Calc1 is 2...
The 'remainder of 6' is then divided by 2, so Calc2 is 3...
That would then split the dose to 2 x 8mg tablets plus 3 x 2mg
tablets, a total of 22mg.
Not a clue how to update Calc1 and Calc2 depending on the entry in
Dose1. Anybody got any ideas?
thabnks in anticipation
DubboPete
I have three fields on a form. Dose1, Calc1 and Calc2.
Dose1 will be the field into which a numerical entry will be made, and
this entry will always be an even number. It's based around a
prescription drug which comes in either 8mg tablets or 2mg tablets,
and a combination of both tablets can be used to make up a dose.
Example: a 22mg prescription dose would consist of 2 x 8mg tablets
(16mg), pls 3 x 2mg tablets (6mg), that's 5 tablets in all amounting
to 22mg. I'd like to know how to calculate the following:
If Dose1 = 22 then Calc1 should be 22 divided by 8 (as a whole number
rounded down) = 2
If Calc1 is 2, then Calc2 should be (Dose1 (22) minus Calc1 (2x8))
divided by 2 = 3
(Dose1-Calc1)/2
'or'
8 goes into 22 twice, with the remainder of 6, so Calc1 is 2...
The 'remainder of 6' is then divided by 2, so Calc2 is 3...
That would then split the dose to 2 x 8mg tablets plus 3 x 2mg
tablets, a total of 22mg.
Not a clue how to update Calc1 and Calc2 depending on the entry in
Dose1. Anybody got any ideas?
thabnks in anticipation
DubboPete