Hi all! I wonder if anyone could kindly offer suggestions for this problem.
I have a database with a table and 2 forms.
One form (frmList) is a list of all records in the database, and the other form (frmInput) displays fields for a single record.
There is a button in frmList which runs the following script. The user clicks a record in frmList, clicks the button, and the selected record opens in frmInput. ID is a text field containing digits and an alpha that is in both frmList and frmInput.
This script works as expected in Access 2010. However we recently upgraded to Access 2013 and since then, this script causes Access to crash ("Access has stopped working..." dialog appears).Code:Private Sub Command9_Click() Dim ID As String strCriteria = "ID = '" & Me.ID.Value & "'" DoCmd.OpenForm "frmInput", acNormal Form_frmInput.Recordset.FindFirst strCriteria End Sub
I have stepped through the script and the line causing the crash is
I can't find any problems with syntax or anything about Recordset.Findfirst being deprecated in 2013 so I suspected some kind of file corruption. To resolve this I have tried:Code:Form_frmInput.Recordset.FindFirst strCriteria
- Compacting and repairing the database
- Decompiling and recompiling the VBA modules
- Creating a fresh database and copying all the objects into it
However none of these have made any difference.
So my questions are - could this be due to a missing library or something? Are there other methods of resolving a corrupt database if that is the problem? Or as a last resort is there an alternative method to Recordset.FindFirst that I can use to open a form to a particular record while retaining the ability to navigate through other records?