R
rdemyan via AccessMonster.com
I have a small popup, modal form that is displayed to users which contains a
number of buttons for opening other forms. There are about 6 buttons all of
which have code in the Form Load event to close the popup/modal form. This
code has been working correctly in all forms that are opened from this
popup/modal form for months. Now all of a sudden, it has stopeed working on
one of the six forms, resulting in the error listed in the title. The only
major change made to the application is that the tables have been upsized and
the app is now linked to SQL Server backend tables instead of Jet.
Here is the code:
Private Sub Form_Load()
On Error GoTo Err_Ctrl
Dim stDocName as String
DoCmd.Echo False
DoCmd.Maximize
DoCmd.Echo True
stDocName = "PopUpModalForm"
X = IsObjectOpen(stDocName,2) '2 is for forms
If X = True Then
DoCmd.Close acForm, stDocName
End If
Exit_Sub:
Err_Ctrl:
The error occurs on the line:
DoCmd.Close acForm, stDocName
However, if I comment out this line, then the error shifts to
DoCmd.Maximize
I thought this might be corruption and have decompiled and recompiled the app.
Same error.
Any ideas??
Thanks.
number of buttons for opening other forms. There are about 6 buttons all of
which have code in the Form Load event to close the popup/modal form. This
code has been working correctly in all forms that are opened from this
popup/modal form for months. Now all of a sudden, it has stopeed working on
one of the six forms, resulting in the error listed in the title. The only
major change made to the application is that the tables have been upsized and
the app is now linked to SQL Server backend tables instead of Jet.
Here is the code:
Private Sub Form_Load()
On Error GoTo Err_Ctrl
Dim stDocName as String
DoCmd.Echo False
DoCmd.Maximize
DoCmd.Echo True
stDocName = "PopUpModalForm"
X = IsObjectOpen(stDocName,2) '2 is for forms
If X = True Then
DoCmd.Close acForm, stDocName
End If
Exit_Sub:
Err_Ctrl:
The error occurs on the line:
DoCmd.Close acForm, stDocName
However, if I comment out this line, then the error shifts to
DoCmd.Maximize
I thought this might be corruption and have decompiled and recompiled the app.
Same error.
Any ideas??
Thanks.