Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running macro from a button causes the form to hang up (non-reponsive) 1

Status
Not open for further replies.

SGooding

Technical User
Jun 11, 2002
7
US
I have a macro that can be used to import data into a simple database. When run from the macros window everything works fine. If I run the macro from a form using a button, the macro runs but then the form hangs up (becomes non-responsive). The database has to be closed and then relaunched to continue any activities.

Has anyone run into this situation? Can you tell me how the correct this problem? The button uses very simple code to run the macro:

Private Sub cmdImport_Click()
On Error GoTo Err_cmdImport_Click

Dim stDocName As String

stDocName = "mcrImport"
DoCmd.RunMacro stDocName

Exit_cmdImport_Click:
Exit Sub

Err_cmdImport_Click:
MsgBox Err.Description
Resume Exit_cmdImport_Click

End Sub
 
Try saving the macro as a module and calling the procedure. Hopefully you'll be able to isolate it down to a particular action by debugging.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top