Updating more then one table from a form at one time

shaz123

Registered User.
Local time
Today, 01:52
Joined
Sep 8, 2006
Messages
81
Hi, im fairly new at MS Access and need some help, i have used the following code on a command button which enables a user to enter information into a inputbox and update the tbl_transaction with this information. At the same time i wanted to make it possible for a information to be updated in the AberdeenWOLines table, for e.g. once the information has been inputed innto the in box, the status field in AberdeenWOLines should be changed to filled.


Private Sub Command22_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim StrSQl As String
Dim i As Integer
Dim tringy As Integer

Set db = CurrentDb

Set rs = db.OpenRecordset("tbl_TransactionMaster")

For i = 1 To Quantity
Stringy = InputBox("Please Enter/Scan Cylinder Serial Number""Works Order Number", "Spec Gas Tracking System")
If Stringy <> "" Then
rs.AddNew
rs![Works Order Number] = Me![Works Order Number]
rs![Line Number] = Me![Line Number]
rs![Cylinder Number] = Stringy

rs.Update
End If
Next i

rs.close
db.close
End Sub


Any help would be grateful
 

Users who are viewing this thread

Back
Top Bottom