G
Guest
Hello..
I am using the following code to delete the forms in my demo upon expiration:
Dim i As Integer
Dim strForm As String
For i = (CurrentProject.AllForms.Count - 1) To 0 Step -1
strForm = CurrentProject.AllForms(n).Name
If strForm <> Me.Name Then
DoCmd.DeleteObject acForm, strForm
End If
Next i
The code works when I place it in the on-close event of the form, however,
it does not work when placed in a module? What am I missing?
I am using the following code to delete the forms in my demo upon expiration:
Dim i As Integer
Dim strForm As String
For i = (CurrentProject.AllForms.Count - 1) To 0 Step -1
strForm = CurrentProject.AllForms(n).Name
If strForm <> Me.Name Then
DoCmd.DeleteObject acForm, strForm
End If
Next i
The code works when I place it in the on-close event of the form, however,
it does not work when placed in a module? What am I missing?