answer - you don't - you should not store calculated values in a table, instead use a group by query when you need to see the total
Incidentally 'date' is a bad name to call a field - date is a reserved word, it is a function which returns todays date. Similarly Type is a reserved word, it is used all over access to identify objects of one sort or another. If you continue to use them as field (or control) names, at some point you will spend hours/days trying to resolve an inexplicable error. Strongly recommend you change them to something more meaningful like invDate and invType. If you want users to see 'Date' or 'Type', use the field caption property - that is what it is for
Thanks Ajax for the tips on the field names. Didn't know that . So u're saying I shouldn't put the 'Total' field there on the table, and instead just take the sum from a query?Or is there a way that I can take the sum from that query and input it in a field in my table? I'm really a beginner at this. Thanks for helping out!answer - you don't - you should not store calculated values in a table, instead use a group by query when you need to see the total
Incidentally 'date' is a bad name to call a field - date is a reserved word, it is a function which returns todays date. Similarly Type is a reserved word, it is used all over access to identify objects of one sort or another. If you continue to use them as field (or control) names, at some point you will spend hours/days trying to resolve an inexplicable error. Strongly recommend you change them to something more meaningful like invDate and invType. If you want users to see 'Date' or 'Type', use the field caption property - that is what it is for
FYI - a link to access reserved words https://support.office.com/en-us/art...7-da237c63eabe. Other tips include don't use spaces or non alphanumeric characters or start field or table names with numbers.
Take the sum from a query - reason is that data can change - you add an additional line, you change the quantity or price. So if these change, you need to recalculate and update the table which is more work - and if there is a glitch, it doesn't get updated so now your total of the detail rows is incorrect.
There are occasions where you store a value - in this case you should store the price, even if it is stored in a product table. The reason is if the price changes, your wouldn't want the invoice to change.