Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Solved: "You can't carry out this action..."


Message #1 by "Michael Mitchell" <michael@m...> on Thu, 13 Mar 2003 22:13:47
I have been having an issue with one of my forms giving me an error and 
even corrupting itself.  Then I found out why and how to fix it.

I had an unbound form that I had a find button on, and the code for it 
would prompt the user for a search string, then would set the forms input 
parameter, then bind the form to a stored procedure.  If I hit the find 
butone again it worked, in fact it kept working until I tried to close the 
form in any fashion.  I would get the error: 

"You can't carry out this action at the present time."
         OR the long version:
"You can't carry out this action at the present time,
you used the DoCmd object in VB to carry out an action.
Access is performing another activity that prevents this action from being 
carried out now."
       Or another version:
"you used the DoCmd object in VB to carry out an action.
Access is performing another activity that prevents this action from being 
carried out now."

What I did to correct it was simply not late bind the form a second time 
by doing in my find button code: 

If Me.RecordSource = "" Then       '** If this is is the first time 
                                    'running it will be ="" otherwise
                                    'it has allready been set
    
    '**Me.InputParameters = "@myInput=" & "'" & MyValue & "'"   ' put above
                                                              ' the If.
    Me.RecordSource = "MyStoredProcedure"
End If

It has been working ever since.

Hope this helps anyone in the futre.

Michael

  Return to Index