"Action cannot be performed" (1 Viewer)

L4serK!LL

Registered User.
Local time
Today, 10:43
Joined
Jul 22, 2002
Messages
59
I got an access application running, the users are redirected to the different forms through a menu...

When a user opens a form and closes it again, the form is simply made invisible but is not 'closed' so to speak, when the user clicks the specific menu item again, the menu is shown again...

Now sometimes after some time a user gets "Action cannot be performed" each time he clicks one of the menu items, no matter which one, and access needs to be closed with ctrl-alt-del and reopenend before he can continue to use the application :(

The onClick procedure has the following code:
Code:
Private Sub CMDOpenBestelbon_Click()
On Error GoTo Err_CMDOpenBestelbon_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Bestelbon"
    
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_CMDOpenBestelbon_Click:
    Exit Sub

Err_CMDOpenBestelbon_Click:
    MsgBox Err.Description
    Resume Exit_CMDOpenBestelbon_Click
    
End Sub

What causes this and how can I solve it?
Is it the fact that the forms aren't closed (but made invisible) and reopened with DoCmd.OpenForm ? (I doubt it as most of the time opening & reopening all works fine) ...


Plz help :eek:

TIA
 

yippie_ky_yay

Registered User.
Local time
Today, 05:43
Joined
Jul 30, 2002
Messages
338
Hey TIA,

closing and re-opening usually work fine because the form is requeried and refreshed. Try adding:
DoCmd.Requery
DoCmd.Refresh
and see if that helps.

-Sean
 

Fizzio

Chief Torturer
Local time
Today, 10:43
Joined
Feb 21, 2002
Messages
1,885
Opening forms all at once or keeping them open and hidden can enhance the loading speed of that form but it can affect the general performance - I'm not sure if opening/closing causes fragmentation issues mind you. Is it really necessary to keep the forms open? Is the load speed affected much by closing and opening them instead of hiding / unhiding?
 

L4serK!LL

Registered User.
Local time
Today, 10:43
Joined
Jul 22, 2002
Messages
59
Fizzio said:
... Is the load speed affected much by closing and opening them instead of hiding / unhiding?
Yup, it's quite a serious speed improvement...

I don't think it's the fact i'm hiding the forms that's causing the problems however because most of the time the problem doesn't occur, my guess would be there's some sort of action still going on that's keeping the showing of the form from being executed...


BTW: TIA = Thanks In Advance, it's not my name ;)
 

yippie_ky_yay

Registered User.
Local time
Today, 05:43
Joined
Jul 30, 2002
Messages
338
Just a thought - but perhaps it's because you are constantly asking access to open files that are already open.

Try replacing your DoCmd statement (from your first post) with:
Forms(stDocName).Visible = True

In your main form (in the Form_Load), open your form and then make it hidden, like this:

stDocName = "Bestelbon"
DoCmd.OpenForm stDocName
me.visible = false

Let me know if this solves it or if you'd like more in-depth instructions!

-Sean
 

Users who are viewing this thread

Top Bottom