Access updating records

Rated 4.10/5 based on 623 customer reviews

Next, build the query like the one below: This query will update the MFG field in the Bot table with the value in the MFG field in the Big table when the PART values match.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?So you can write something like this (not the best example, but can help you to get an idea): Consider a simpler approach.I doubt you need to be concerned with the form's Current Record property.And I don't see why you should need a command button for "Has been Completed" and another for "Has not been Completed".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.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).

I would like the queries to be invisible while they are running, but currently the user sees 50 query windows open/close which is ugly.

This is my first shot at VBA, and after an hour of searching I cannot find anything to solve my problem. Working in Microsoft Access 2007 Further Info All tables are normalized Vehicle Table: Contains vehicle_id(pk), as well as rego and model etc Job Table: Contains job_id(pk), vehicle_id(fk) and other info about what needs to happen, as well as the next occurance date, days between each occurance of the job (all jobs repeat) and other info Job History Table: Contains job_history_id(pk), job_id(fk), date completed and comments When the job completed button is pressed, it should create a new entry in the job history table with the current date, any comments and the job id This is the script I am trying to get working Private Sub Command29_Click() Dim str SQL1 As String Dim str SQL2 As String Set Rs = Current Rs Set db = Current Db str SQL1 = "INSERT INTO completed_jobs(JOB_ID, DATE_COMPLETED, COMMENTS) VALUES " & Rs! @Matt I am 90% sure I am using a bound form (Like I said, new to Access, been looking at everything people have suggested and learning as I go).

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?

If this will not help, you can look to a couple of another directions: 1) Update records using SQL code.

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.

Leave a Reply