The following code crashes MS Access every time. The database used to reside on a laptop with Access 2007. Issues have occurred since I’ve installed the database on a PC running Access 2013.
The code is triggered by double clicking a list box, it’s the same code as other forms that bizarrely continues to work without issue.
I’ve commented out all the code and reinstated each line until Access crashes – it occurs at the line Set rs = Forms!MyForm.Recordset.Clo
Previously the code had the following declaration: Dim rs as DAO.Recordset so I changed it to fall in line with the other forms code that clearly does work ie Dim rs As Object.
Suspect it may be a reference issue but why does it work on other forms? I've imported all objects into a new database but it continues to crash.....
Dim rs As Object
Set rs = Forms!MyForm.Recordset.Clone
rs.FindFirst "[signinID] = " & Str(Nz(Me![List122], 2))
If Not rs.EOF Then Forms!MyForm.Bookmark = rs.Bookmark
DoCmd.Close acForm, Me.Name