L
Lendog
Here's the basic problem: I have a section of code whose purpose is to move
the form to the record of my chosing. The field in the form looks to see if
an existing data has been changed, and if so attempts to find the record that
matched it and moves the bookmark to it. I've used this same code in earlier
versions of Access with no problems.
When the code runs the first time the databse is opened it makes it all the
way to the bookmark line before erroring out stating that my "recClone"
recordset is "3420: Object Invalid or No Longer Set"
When the code runs the second time, it gets this error on the 'findfirst' line
I've looked at it about a dozen different ways, and tried several things,
and I'm beginning to believe that I have a corrupted dao360.dll file. Here's
the code:
If Not Me.NewRecord Then
Dim recClone As DAO.Recordset
Set recClone = Me.RecordsetClone
recClone.FindFirst ("RFI = '" & Me.RFI & "'")
If Not recClone.NoMatch Then
Cancel = True
Me.Undo
Me.Bookmark = recClone.Bookmark
Else
If MsgBox("RFI not found. Change current record?", vbYesNo, _
"Change Current RFI") = vbNo Then Cancel = True
End If
recClone.Close
Set recClone = Nothing
End If
If I changed things around, this next piece of code runs successfully, but
only the first time, then it errors out at the 'Findfirst' line as the first
one does.
If Not Me.NewRecord Then
Dim intPosition As Integer
Dim recClone As DAO.Recordset
Set recClone = Me.RecordsetClone
recClone.FindFirst ("RFI = '" & Me.RFI & "'")
intPosition = recClone.AbsolutePosition
If Not recClone.NoMatch Then
Cancel = True
Me.Undo
Me.Recordset.MoveFirst
Do While Not Me.Recordset.AbsolutePosition = intPosition
Me.Recordset.MoveNext
Loop
Else
If MsgBox("RFI not found. Change current record?", vbYesNo, "Change
Current RFI") = vbNo Then Cancel = True
End If
recClone.Close
Set recClone = Nothing
End If
Has anyone run into this?
the form to the record of my chosing. The field in the form looks to see if
an existing data has been changed, and if so attempts to find the record that
matched it and moves the bookmark to it. I've used this same code in earlier
versions of Access with no problems.
When the code runs the first time the databse is opened it makes it all the
way to the bookmark line before erroring out stating that my "recClone"
recordset is "3420: Object Invalid or No Longer Set"
When the code runs the second time, it gets this error on the 'findfirst' line
I've looked at it about a dozen different ways, and tried several things,
and I'm beginning to believe that I have a corrupted dao360.dll file. Here's
the code:
If Not Me.NewRecord Then
Dim recClone As DAO.Recordset
Set recClone = Me.RecordsetClone
recClone.FindFirst ("RFI = '" & Me.RFI & "'")
If Not recClone.NoMatch Then
Cancel = True
Me.Undo
Me.Bookmark = recClone.Bookmark
Else
If MsgBox("RFI not found. Change current record?", vbYesNo, _
"Change Current RFI") = vbNo Then Cancel = True
End If
recClone.Close
Set recClone = Nothing
End If
If I changed things around, this next piece of code runs successfully, but
only the first time, then it errors out at the 'Findfirst' line as the first
one does.
If Not Me.NewRecord Then
Dim intPosition As Integer
Dim recClone As DAO.Recordset
Set recClone = Me.RecordsetClone
recClone.FindFirst ("RFI = '" & Me.RFI & "'")
intPosition = recClone.AbsolutePosition
If Not recClone.NoMatch Then
Cancel = True
Me.Undo
Me.Recordset.MoveFirst
Do While Not Me.Recordset.AbsolutePosition = intPosition
Me.Recordset.MoveNext
Loop
Else
If MsgBox("RFI not found. Change current record?", vbYesNo, "Change
Current RFI") = vbNo Then Cancel = True
End If
recClone.Close
Set recClone = Nothing
End If
Has anyone run into this?