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