I'm looking for some assistance with some (maybe) complex calculations. As I'm not sure whether to use vba code or the Expression builder, I'm putting the post here.
A screenshot of the form is attached, which hopefully will make my explanation easier to understand.
The user is supposed to enter the contents of the tanks "7P" and "7S" into the corresponding text boxes. Furthermore the user should enter the total amount of water produced on the Water Maker in the text box "Wtr Maker".
And finally, if any water has been received from a boat, it should be entered into the "Received" text box. If nothing has been received, that text box should be left with a zero.
The remaining three text boxes (Total, Made & Used) should be calculated. For these calculations, I need to use the data just entered, and also some of the data entered "yesterday". Yesterdays data is obtainable from a tabel through the qryTank query (the date is the Primary key for the table).
- The formula for the "Total" I got already through the Expression builder
- "Made" text box:
The formula should go something like this:
[Made] = [Wtr Maker (the number from today)] - [Wtr Maker (the number from yesterdat)].
- "Used" text box:
This might be a bit more tricky. The formula should be something like this:
[Used] = [Total (Yesterdays number)] + [Made] + [Received] - [Total (Todays number)]
I'm not sure whether above is possible, but if it is, I will appreciate if somebody can assist.
I hope above is clear and understandable. If not, please let me know.
/Anders
A screenshot of the form is attached, which hopefully will make my explanation easier to understand.
The user is supposed to enter the contents of the tanks "7P" and "7S" into the corresponding text boxes. Furthermore the user should enter the total amount of water produced on the Water Maker in the text box "Wtr Maker".
And finally, if any water has been received from a boat, it should be entered into the "Received" text box. If nothing has been received, that text box should be left with a zero.
The remaining three text boxes (Total, Made & Used) should be calculated. For these calculations, I need to use the data just entered, and also some of the data entered "yesterday". Yesterdays data is obtainable from a tabel through the qryTank query (the date is the Primary key for the table).
- The formula for the "Total" I got already through the Expression builder
- "Made" text box:
The formula should go something like this:
[Made] = [Wtr Maker (the number from today)] - [Wtr Maker (the number from yesterdat)].
- "Used" text box:
This might be a bit more tricky. The formula should be something like this:
[Used] = [Total (Yesterdays number)] + [Made] + [Received] - [Total (Todays number)]
I'm not sure whether above is possible, but if it is, I will appreciate if somebody can assist.
I hope above is clear and understandable. If not, please let me know.
/Anders