Execution stops at DoCmd.OutputTo line

raktims

Registered User.
Local time
Today, 20:05
Joined
Jul 29, 2003
Messages
19
Hi,

I have DoCmd.OutputTo code which is working fine. But the execution stops at that line and ignores the rest of the code. Any suggestions how I can execute the remaining code which is an Update query which should be executed if the .xls file is created.

The code snippet is given below.

Happy Haloween
Raktim.

****************************************************

If flagUp Then
Dim varX As Variant
varX = DLookup("[Status]", "Groups", "[GroupID] =" & GID)
stDocName = "TrackSheet_Rep"
DoCmd.OutputTo acReport, stDocName
MsgBox ("I am HERE")
' Can't SEE the MsgBox and the rest of the code is ignored
If varX = "No" Then
DoCmd.SetWarnings False
DoCmd.RunSQL (sql)
DoCmd.SetWarnings True
End If
Else
MsgBox " Records won't be moved to Spreadsheet"
Exit Sub
End If
 
Is it possible that the app is waiting for input from the user? Like the output type, and filename?

and the the first parameter should be
acOutputReport, not acReport
 
Gosh, here it is October 2012 and I am experiencing the same issue with Access 2010.

I didn't see a resolution to this. I will keep searching.

Dave

Hi,

I have DoCmd.OutputTo code which is working fine. But the execution stops at that line and ignores the rest of the code. Any suggestions how I can execute the remaining code which is an Update query which should be executed if the .xls file is created.

The code snippet is given below.

Happy Haloween
Raktim.

****************************************************

If flagUp Then
Dim varX As Variant
varX = DLookup("[Status]", "Groups", "[GroupID] =" & GID)
stDocName = "TrackSheet_Rep"
DoCmd.OutputTo acReport, stDocName
MsgBox ("I am HERE")
' Can't SEE the MsgBox and the rest of the code is ignored
If varX = "No" Then
DoCmd.SetWarnings False
DoCmd.RunSQL (sql)
DoCmd.SetWarnings True
End If
Else
MsgBox " Records won't be moved to Spreadsheet"
Exit Sub
End If
 

Users who are viewing this thread

Back
Top Bottom