Updating ms access from a form
If you need to update some field of underlying dataset, you can write something like If your form has control bound to "Some Field", then the form will be updated automatically.
If this will not help, you can look to a couple of another directions: 1) Update records using SQL code.
The part I'm adding calculates an additional loyalty discount based on order history.
Private Sub Form_After Update() Dim Disc As Variant Dim TF As Variant 'Calculate the total added firkins every time a new order item is entered TF = 0 With Me.
I'm so sorry to have taken so much of your time but your confirmation that I had the basics right has led me to a happy resolution.
The last step in creating the order is a check that the date had been entered before it lets you out, hence the fact that saving and reopening shows the correct updated total.
Add a "Yes/No" data type field to the table which is used by your form's record source. Then your form can have a check box control for completion_status.
If I create a new order with some order items, leave the form open and run the total's source query (qry Firkins Total In Period, SQL above) directly from the Navigation Pane it gives me the same total as displayed, ie with the total not having updated to take account of the firkins in the new order.However, the entered data DOES appear in the table(s). What might be causing the forms to not display that data? But if I don't add a date before entering order items it's not going to pick them up. Move Next Loop End With 'Trying things to get the total firkins to update If Me. I thought this was supposed to be equivalent to closing and reopening the form but not so for the way it's configured. I put a break point in the After Update event I attached above and it stepped through to the end as intended. One of the criteria for including firkins in the total displayed is that the order date falls within the specified time period.