Error 3326: This Recordset is not Updateable

S

slim

Further to my problem with updating price field, I've
changed the code to read as follows and it comes up with
the error 3326 message. What is wrong with it? Can anyone
help? Please!!! I'm a novice at this.
Private Sub CurrentPrice_Enter()
Dim mydb As Database
Dim productSet As Recordset
Dim ProductNumber As Integer
Dim UnitCost As Double

Set mydb = CurrentDb()
Set productSet = mydb.OpenRecordset("tblProducts")

ProductNumber = [Form_frmCustomersOrderDetails
subform].ProdID.Value
productSet.Index = "PrimaryKey"
productSet.Seek "=", ProductNumber

UnitCost = productSet!UnitPrice
[Form_frmCustomersOrderDetails subform].CurrentPrice.Value
= UnitCost

productSet.Close

End Sub
 
A

Arvin Meyer

Seek only works on local tables (or if you set a path to the database which
is the container for the table) So if you did something like:

Dim ws As DAO.Workspace
Dim db As DAO.Database
Dim rst As DAO.Recordset

Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("FullPathToData.MDB")
Set rst = db.OpenRecordset("tblSourceTable", dbOpenTable)

'Now you can use the Seek method on this recordset

Alternatively, use the FindFirst method.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

slim said:
Further to my problem with updating price field, I've
changed the code to read as follows and it comes up with
the error 3326 message. What is wrong with it? Can anyone
help? Please!!! I'm a novice at this.
Private Sub CurrentPrice_Enter()
Dim mydb As Database
Dim productSet As Recordset
Dim ProductNumber As Integer
Dim UnitCost As Double

Set mydb = CurrentDb()
Set productSet = mydb.OpenRecordset("tblProducts")

ProductNumber = [Form_frmCustomersOrderDetails
subform].ProdID.Value
productSet.Index = "PrimaryKey"
productSet.Seek "=", ProductNumber

UnitCost = productSet!UnitPrice
[Form_frmCustomersOrderDetails subform].CurrentPrice.Value
= UnitCost

productSet.Close

End Sub
 
Joined
Oct 13, 2006
Messages
1
Reaction score
0
Im having the same error message to, my form is based on a query, other records can be updated except for one can anyone help, this is 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] & "..And For Line Number " & [Line Number] & "...", "Please Enter/Scan Cylinder Serial Number")


Stringy1 = InputBox("Please Input The Transaction Date, (DD / MM / YY)", "Spec Gas System", Me!Text20 & "'")


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, (DD / MM / YY)", Me!Text20 & "'")
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
rs!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
' End If
Next i


rs.close
db.close
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top