L
Laphan
Hi All
I'm struggling with how I can unload all used forms when the user closes my
Access 'app'.
Basically I have around 9 forms in my Access DB and I want to unload all of
the used forms when the user clicks any of the 'X's on the visible forms.
In essence if they click the 'X' on any form then the app has ended and I
need to close down all forms.
In each Form_Close event I have a call to a public sub that does the
following:
Dim intChoice As Integer
intChoice = MsgBox("Are you sure you wish to quit the WebLog program?",
vbOKCancel)
If intChoice = 1 Then
Dim f As Form
' close db objects
Call CloseConnections
' unload all forms
For Each f In Forms
DoCmd.Close acForm, f, acSaveNo <<< its this part that I'm stuck on
<< I was using unload f, but that it didn't work either its as if I'm
using a completely different syntax
<< to what Access is expecting.
Next
End If
I won't know which forms the user will have opened on their travels so I
need to go through the active forms/collection.
Any ideas?
Thanks
I'm struggling with how I can unload all used forms when the user closes my
Access 'app'.
Basically I have around 9 forms in my Access DB and I want to unload all of
the used forms when the user clicks any of the 'X's on the visible forms.
In essence if they click the 'X' on any form then the app has ended and I
need to close down all forms.
In each Form_Close event I have a call to a public sub that does the
following:
Dim intChoice As Integer
intChoice = MsgBox("Are you sure you wish to quit the WebLog program?",
vbOKCancel)
If intChoice = 1 Then
Dim f As Form
' close db objects
Call CloseConnections
' unload all forms
For Each f In Forms
DoCmd.Close acForm, f, acSaveNo <<< its this part that I'm stuck on
<< I was using unload f, but that it didn't work either its as if I'm
using a completely different syntax
<< to what Access is expecting.
Next
End If
I won't know which forms the user will have opened on their travels so I
need to go through the active forms/collection.
Any ideas?
Thanks