You can't carry out this action at the present time

  • Thread starter rdemyan via AccessMonster.com
  • Start date
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.
 
G

Guest

from Rainbow01 Hong Kong

what mean for ---> IsObjectOpen
is it Custom Define Function??
if yes, please post the code of that function for discuss

"rdemyan via AccessMonster.com" 來函:
 
R

rdemyan via AccessMonster.com

Thank you for the response, Rainbow.

Yes, this is a custom function, but I'm beginning to realize that the error
is being caused by SQL in the VBA code that SQL Server apparantly does not
like. The SQL is in a subform that is on the form where the error occurs.
Once this error occurs, it will continue to occur until the application is
shutdown.

I will be posting the SQL that is causing the problem later. This SQL works
just fine in Jet, but apparantly is causing problems for SQL Server.


from Rainbow01 Hong Kong

what mean for ---> IsObjectOpen
is it Custom Define Function??
if yes, please post the code of that function for discuss

"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
[quoted text clipped - 41 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top