Please help me with saving form totals

lfctez

New member
Local time
Today, 02:28
Joined
Apr 30, 2013
Messages
4
Hey everyone!
After hours and hours of trying to find a solution, I have decided to come on here and ask for some advice.

Basically I have created a form to input invoice details with a sub form to input the products with the prices etc.

This all works fine but now I want to create totals such as Total Goods, Total VAT and Invoice Total.
After many searches of the internet, I found out how to do this and put in the calculations which works fine and displays on the main form without a problem.

Now I have a problem as these need to be saved to one of my tables.
As these are unbound text boxes with only the calculation on, the data is not being recorded onto the form which is what I want.

Can I have some help on how to go about this?
Do I have to create a macro of some sort to do this or?

Any help is gratefully appreciated but bare in mind I am not a big access user so putting it as simple as would be great if possible.

I have included a few images of what I have done but if you would like the database file I can upload that (I will take away all the information that is sensitive to me if that is okay?)

Thank you!
 

Attachments

The totals are calculations and they should not normally be saved to a table but calculated whenever and wherever they are needed.
 
Thanks for the reply.
I understand that it should not be saved normally but in my case I would like them saved.
Is this still possible?
 
Hi,

One of the easier ways to do this without too much coding is to make some bound invisible text boxes to store the totals. Assign the unbound text box(es) you use for displaying totals to desired hidden text boxes in your form. Simply add below code to your input fields' after update event or make a "Save" button to trigger it.

me.HiddenTotalTextBox1 = me.CalculatedTotalTextBox1
me.HiddenTotalTextBox2 = me.CalculatedTotalTextBox2

if me.dirty then
me.dirty = false
end if

JD

PS It might be good to add it to the form's on close event too if you want to enforce records are always saved.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom