By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,672 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

invalid operation

P: n/a


CaN somebody help me find the error in my code ? I get the error
"invalid operation" with the following line :

tdf.Fields("CustomerID") = 121

Public Function Test()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim fld As DAO.Field
Dim tdf As DAO.TableDef

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("orders1", dbOpenDynaset)
Do While Not rst.EOF

rst.MoveNext
Set tdf = dbs.TableDefs("Orders1")

Set fld = tdf.Fields("CustomerID')
tdf.Fields("CustomerID") = 121

Loop

rst.Close
Set rst = Nothing
Set dbs = Nothing
End Function

Dec 14 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
try
Do While Not rst.EOF

rst.Edit
rst.Fields("CustomerID")=121
rst.Update
rst.MoveNext

Loop

Dec 14 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.