presence76
Board Regular
- Joined
- May 11, 2004
- Messages
- 76
I am attemtping to update a table in access from a value received from a form. When I run it, I get the following error : run time error 3265 - 'item not found in this collection. Below is the code:
I have been searching this site for a while to try to solve this. I know it's something real simple. Any help would be appreciated. Thanks.
Code:
Dim newmgmtcode As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb()
newmgmtcode = Forms![form1]![textmgmtcode].Value ' get new mgmt code from screen
Set rst = dbs.OpenRecordset("tblmgmtcodecurrent")
With rst
.AddNew
.Fields(1).Value = newmgmtcode
.Update
End With
I have been searching this site for a while to try to solve this. I know it's something real simple. Any help would be appreciated. Thanks.