Modules open in debug

clauses

Registered User.
Local time
Today, 21:39
Joined
Feb 9, 2001
Messages
56
I have an applicaiton that uses a query to create a file using the following structure

DoCmd.OpenQuery "QueryName", acnormal,acedit

The module is called from the switchboard using a macro. Whenver the module is called in this way it opens in debug mode and the user has to press F5 for the module to run. Once F5 is presed the module builds the file without problem. Why is the module opening in debug mode and how can I keep this from occuring so that the Application requires no user intervention.
 
Is there a STOP command where it stops?

Have you recompiled the module?

Have you run a Compact on the Database?

If it is still stoping after these issue are looked at. Post the code and the command the Macro Uses.
 
The Database has been compacted, a stopmacro does exist, and the module has been recompiled. The macro consists of a opemmodule action that opens the follwing module.

Private Sub runStateFile()
On Error GoTo Err_runStateFile
Dim stDocName As String

DoCmd.OpenQuery "StateFile", acViewNormal, acEdit

Exit_runStateFile:
Exit Sub

Err_runStateFile:
MsgBox Err.Description
Resume Exit_runStateFile

End Sub
 
The OpenModule Action is your problem. That is the same as selecting the module in the Database window and choosing Design.

Change runStateFile() from a Sub to a Function.

Then use RunCode action instead of OpenModule.
 

Users who are viewing this thread

Back
Top Bottom