Please help with error message

shaz123

Registered User.
Local time
Today, 09:05
Joined
Sep 8, 2006
Messages
81
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
 
thanxs for your quick response,

The form is bound to a query, with a number of tables. Me.status refers to the text field "AberdeenWOLines.Status". Do u think it could be because i have coded the command button to luk up the tbl_transactionMaster "Set rs = db.OpenRecordset("tbl_TransactionMaster")"
were as the field i am trying to amend is in the AberdeenWOlines tables.

If yes how would i get the command button to look up both tables.
 

Users who are viewing this thread

Back
Top Bottom