Good afternoon and thank you for taking a moment to read my thread.
I've got a multitude of legacy databases that were all created as Access 2003-2007 .mdb files. After having upgraded to Office 2010 a few years ago, the company is now upgrading to Office 2013, so now all of these applications are being dragged, kicking and screaming, into the modern world.
One application, in particular, is giving me grey(er) hair. The user has a form where they'll enter an employee's LAN ID or name to access their record. The code below will populate the form:
Code:
Sub LoadEmployee(Senario As Integer)
On Error GoTo errorone
Dim Seach_Emp As Object
Dim rsRecord As Object
Select Case Senario
Case 1
Set Seach_Emp = CurrentDb.OpenRecordset("SELECT [Candidate Unique ID], Name, [LAN ID], [No call center experience], [Long commute], [Recently moved to community], [College commitments], [Other (please specify)], [Other explaination] FROM [Hire profile] WHERE [Candidate Unique ID]=" & [LAN ID lookup] & ";")
[Name lookup] = Seach_Emp![Candidate Unique ID]
Set rsRecord = Me.Recordset.Clone
rsRecord.findfirst "[Candidate Unique ID] = " & [LAN ID lookup]
If Not rsRecord.EOF Then Me.Bookmark = rsRecord.Bookmark
Case 2
Set Seach_Emp = CurrentDb.OpenRecordset("SELECT [Candidate Unique ID], Name, [LAN ID], [No call center experience], [Long commute], [Recently moved to community], [College commitments], [Other (please specify)], [Other explaination] FROM [Hire profile] WHERE [Candidate Unique ID]=" & [Name lookup] & ";")
[LAN ID lookup] = Seach_Emp![Candidate Unique ID]
Set rsRecord = Me.Recordset.Clone 'error here in Access 2013
rsRecord.findfirst "[Candidate Unique ID] = " & [Name lookup]
If Not rsRecord.EOF Then Me.Bookmark = rsRecord.Bookmark
End Select
Seach_Emp.Close
errorone:
Exit Sub
End Sub
The error occurs on line "Set rsRecord = Me. Recordset.Clone" in either Case 1 or Case 2; the error actually causes A2013 to crash.
This code works flawlessly in A2010. This is only a problem with the few people who have A2013 instead. Eventually, everyone will be migrated to 2013, so remaining in the A2010 environment isn't possible.
I have little experience with recordset clones and bookmarks, so hope that someone could shed some light on this issue. I hope I've explained my issue clearly enough. Thanks again for your time.
Amras