David R
I know a few things...
- Local time
- Today, 02:44
- Joined
- Oct 23, 2001
- Messages
- 2,633
If you're working in DAO and want to ensure your memory is being reclaimed properly, is there any purpose to this:
Set CurrentDb = Nothing
Note that I am not setting a reference variable to it since this is the only thing I am using it for. Does the simple act of calling it cause memory to be used wastefully? Here's a concrete example:
Set CurrentDb = Nothing
Note that I am not setting a reference variable to it since this is the only thing I am using it for. Does the simple act of calling it cause memory to be used wastefully? Here's a concrete example:
Code:
Public Function fGetLatestContact(CID As Long) As String
Dim rstLastCon As DAO.Recordset
Set rstLastCon = CurrentDb.OpenRecordset("SELECT TOP 1 [DateContacted] FROM tableContactDetails WHERE [ContactID] = " & CID & " ORDER BY [DateContacted] DESC", dbOpenSnapshot)
If rstLastCon.RecordCount Then fGetLatestContact = rstLastCon!DateContacted
Set rstLastCon = Nothing
End Function