I am testing this code to solve a larger problem
Private Sub Command0_Click()
Dim rst As Recordset
*** Set rst = CurrentDb.OpenRecordset("tblDepartment"
rst.Index = "PrimaryKey"
rst.AddNew
rst!DepartmentName = "new dept"
rst.Update
'rst.Bookmark = rst.LastModified
rst.MoveNext
End Sub
I get an error on the indicated line (***) that says there is a type mismatch (I assume trying to assign my table to a Recordset ojbect.) Do I need to change my table properties? Why is this a type mismatch?
Private Sub Command0_Click()
Dim rst As Recordset
*** Set rst = CurrentDb.OpenRecordset("tblDepartment"
rst.Index = "PrimaryKey"
rst.AddNew
rst!DepartmentName = "new dept"
rst.Update
'rst.Bookmark = rst.LastModified
rst.MoveNext
End Sub
I get an error on the indicated line (***) that says there is a type mismatch (I assume trying to assign my table to a Recordset ojbect.) Do I need to change my table properties? Why is this a type mismatch?