If I substitute one of my own tables into the 4th line,
the code shown below still fails on that same line
at runtime. Any ideas why?
Sub Button0_Click ()
Dim MyDB As Database, MyTable As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set MyTable = MyDB.OpenRecordset("Products", DB_OPEN_TABLE)
MyTable.Index = "Supplier ID"
Do Until MyTable.NoMatch
MyTable.Seek "=", 1
If Not MyTable.NoMatch Then
MyTable.Edit
MyTable("Supplier ID") = 2
MyTable.Update
End If
Loop
MyTable.Close
End Sub
xxxxxxxxxx Bottom of Code Snippet xxxxxxxxxxxx
Here's the error message I get...
Invalid operation.
Possible causes:
You tried to write to a read-only property. See the Usage
section of the Help topic for the property to determine whether or not
it's read write.
You tried to use a method or property on a type of Recordset
object that the method or property doesn't apply to. See the
Recordset Object,
Recordsets Collection - Summary topic to determine which methods and
properties apply to a given type of Recordset object.
You tried to append a property to a Properties collection of
an object that doesn't support user-defined properties.