Trevor Best <bouncer@localhost> wrote in
news:s5********************************@4ax.com:
(Looks at Lyle now)
When you access that .RecordsetClone without explicity setting a
variable and closing and setting it to nothing afterwards, is the
reference to it still lingering around somewhere?
I believe referring to .recordsetclone creates not only another recordset,
but also another database, well, ... instance of the database. These two
objects die with the form; that is they do not have to be slaughtered by
helicopter gunships or murdered in the woods, for justification or revenge
or to be sure they don't do or say anything embarrassing to ourselves;
they're just like McArthur - they just fade away (but they don't smell as
bad).
Try this:
Private Sub Form_Load()
Dim z As Long
With Me
.SelTop = .RecordsetClone.RecordCount - _
(.InsideHeight - .FormHeader.Height - .FormFooter.Height) / _
.Detail.Height
.SelTop = .RecordsetClone.RecordCount
For z = 0 To DAO.DBEngine(0).Databases.Count - 1
MsgBox z & ": " & DAO.DBEngine(0)(z).Recordsets.Count
Next z
End With
End Sub
One gets two messages:
0: 0
and
1: 1
(assuming nothing else is happening in the db at the time.)
--
Lyle