A
alex
Hello,
I'm trying to write code that deletes all open unhidden forms...
I have this code:
Dim db As Access.Application
Dim frm As Form
Set db = Application
For Each frm In db.Forms
If frm.Visible Then
DoCmd.Close acForm, frm.Name
'Debug.Print frm.Name
End If
Next frm
Although the appropriate forms will print in the immediate window; the
code will not delete them all. Strangely, the form that gets opened
second seems to remain; i.e., if three forms are opened, the one that
was opened first and last will close.
Any thoughts? Thanks,
alex
I'm trying to write code that deletes all open unhidden forms...
I have this code:
Dim db As Access.Application
Dim frm As Form
Set db = Application
For Each frm In db.Forms
If frm.Visible Then
DoCmd.Close acForm, frm.Name
'Debug.Print frm.Name
End If
Next frm
Although the appropriate forms will print in the immediate window; the
code will not delete them all. Strangely, the form that gets opened
second seems to remain; i.e., if three forms are opened, the one that
was opened first and last will close.
Any thoughts? Thanks,
alex