Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function CloseAllRecordsets() As Integer
Dim wsCurr As Workspace
Dim dbCurr As Database
Dim dbWrite As Database
Set dbWrite = CurrentDb
Dim Str As String
Dim Rs As Recordset
Dim frm As Form
For Each frm In Application.Forms
If frm.Name <> "UserLogin" Then
frm.Close
End If
Next
For Each wsCurr In Workspaces
For Each dbCurr In wsCurr.Databases
For Each Rs In dbCurr.Recordsets
Str = "INSERT INTO [OpenRecordSets] ( [RSname], [RsCount], [Date] ) SELECT '" & Rs.Name & "'," & Rs.RecordCount & ",#" & Date & "#"
dbWrite.Execute Str
MsgBox "Recordset " & vbCrLf & Rs.Name & vbCrLf & Rs.RecordCount & " record(s) was left open - now closing it.", vbCritical, "Validation"
Rs.Close
Set Rs = Nothing
Next
dbCurr.Close
Set dbCurr = Nothing
Next
wsCurr.Close
Set wsCurr = Nothing
Next
End Function