I have a patient database that will not close. It only happens if a new daily record is added. I can use the exit option if I look at data or a report, but when I add a new daily record it copies data from a previous days record into the new record using a recordset clone. After that, when you click on the close button (Application.Quit), only the main form closes leaving the Access application window open and unclosable. Neither the control box exit button or the File menu Exit item will close the application window. It needs to be closed in task manager.
I got the recordset clone code online somewhere (I know I should have commented that). Here it is:
The only reference I could find to this problem was in the Knowledge Base:
I figured it was a recordset that was still open so I used Find Next and explicitly closed every recordset but that didn't resolve the problem.
I get no error messages at the time of close, just this blank unclosable application window. Is there anyway to list any object that is still open?
Does anyone have any ideas? Thanks.
Kris
I got the recordset clone code online somewhere (I know I should have commented that). Here it is:
Code:
Dim RS As Recordset
Dim c As Control
Dim FillFields As String
Dim FillAllFields As Integer
On Error Resume Next
'Exit if not on the new record.
If Not F.NewRecord Then
Exit Function
Else
'Go to the last reocrd of the form recordset (to autofill form)
Set RS = F.RecordsetClone
RS.MoveLast
'Exit if no records
If Err <> 0 Then Exit Function
'Going to fill all fields
FillAllFields = -1
F.Painting = False
'Visit each field on the form
For Each c In F
'fill each field
If FillAllFields Then
c = RS(c.ControlSource)
End If
Next
'Need to delete the info in certain fields
F!PICU_Units = Null
'List of fields to exclude, edited out
F.Painting = True
End If
RS.Close
Set c = Nothing
The only reference I could find to this problem was in the Knowledge Base:
I figured it was a recordset that was still open so I used Find Next and explicitly closed every recordset but that didn't resolve the problem.
I get no error messages at the time of close, just this blank unclosable application window. Is there anyway to list any object that is still open?
Does anyone have any ideas? Thanks.
Kris