Hope I am posting this in the right area, I have a command button on form, which when clicked on brings up an inputbox, and inserts particular information into certain tables. Most of the code works however when i want to change the cylinder status from outstanding to filled in the lines table it keeps bringing up an error message. Bearing in mind that i have set the status default value to "outstanding" within the design view of the lines table.
The code line in red is were the error meesage is occuring, the rest is all fine, the error message apearing is "Run-time error 3326', this recordset is not updateable".
My Code:
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("Do You Wish To Fill A Cylinder For Works Order Number:-" & [Works Order Number] & [Line Number], "Please Enter/Scan Cylinder Serial Number")
Stringy1 = InputBox("Please Input The Transaction Date", "Spec Gas System")
If [Batch Number] = True Then
Stringy2 = InputBox("Please Type in the Type of Batch Number")
End If
If [Expiration Required] = True Then
Stringy3 = InputBox("Please Type in the Type of Expiration Date")
End If
If Stringy <> "" Then
rs.AddNew
rs![Works Order Number] = Me![Works Order Number]
rs![Line Number] = Me![Line Number]
rs!CustNo = Me!CustNo
rs!ProdNo = Me!ProdNo
Me!Status = "Filled"
rs!Status = "Available To Deliver"
rs![Cylinder Number] = Stringy
rs![Transaction Date] = Stringy1
rs![Batch Number] = Stringy2
rs![Expiration Required] = Stringy3
rs.Update
End If
Next i
rs.close
db.close
End Sub
Any IDEAS
The code line in red is were the error meesage is occuring, the rest is all fine, the error message apearing is "Run-time error 3326', this recordset is not updateable".
My Code:
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("Do You Wish To Fill A Cylinder For Works Order Number:-" & [Works Order Number] & [Line Number], "Please Enter/Scan Cylinder Serial Number")
Stringy1 = InputBox("Please Input The Transaction Date", "Spec Gas System")
If [Batch Number] = True Then
Stringy2 = InputBox("Please Type in the Type of Batch Number")
End If
If [Expiration Required] = True Then
Stringy3 = InputBox("Please Type in the Type of Expiration Date")
End If
If Stringy <> "" Then
rs.AddNew
rs![Works Order Number] = Me![Works Order Number]
rs![Line Number] = Me![Line Number]
rs!CustNo = Me!CustNo
rs!ProdNo = Me!ProdNo
Me!Status = "Filled"
rs!Status = "Available To Deliver"
rs![Cylinder Number] = Stringy
rs![Transaction Date] = Stringy1
rs![Batch Number] = Stringy2
rs![Expiration Required] = Stringy3
rs.Update
End If
Next i
rs.close
db.close
End Sub
Any IDEAS