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
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