Updating ms access from a form Freechattrials
I have a job-tracking system, and there is a query that returns results of all jobs that are overdue. Execute str SQL2, db Fail On Error End Sub is completely incorrect, I believe this is what I need to figure out?
I have a form that displays each of these jobs one-by-one, and has two buttons (Job has been completed, and Job not completed). I cannot find a way to get access to the current record to update it's contents if the "Has been Completed" button is pressed, the closest I can get is the long number which represents the records position in the form. This is called on button-press I am posting an image which shows the form (non-continuous).
However, the entered data DOES appear in the table(s).
What might be causing the forms to not display that data?
I really want the total to be updating as each new order item is added to the first subform.
I've looked closer at the query that feeds the Total Firkins In Period field and the problem seems to be that using the After Update event in the subform doesn't cause it to update. Before closing, even moving the focus out to another control on the form doesn't do an update.
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.
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. There is of course an ID for the job (Just not shown, no need to be visible), but how would I access this to perform an operation on it?SQL I can do, integrating with Access/VBA I am new at As I understand your situation, your form is data-bound bound (you can get record index), so - your form already located on this record. Total Firkins) AS Total In Period FROM qry Firkins By Customer Within Date Range GROUP BY qry Firkins By Customer Within Date Range. Ship Date FROM qry Firkins Total Per Order WHERE (((qry Firkins Total Per Order. [Orders].[Start Date] And Date())); The process involves calculating how many firkins (beer volume) the current customer has bought over a defined number of weeks including items in the current order, for which items are added via the subform. This is the SQL but it may not be too clear what's going on as this is at the end of a string of queries. Customer ID, Sum(qry Firkins By Customer Within Date Range. Sum Of Firkins AS Total Firkins, qry Firkins Total Per Order.
For example, you have ID of record that should be updated in the form data set, so you can write something like: 2) You can look at the Bookmark property - both Recordset and Form has this property, it describes the record position.