D
Dorci
I have the following module that suddenly stopped running. The subroutine runs just fine, but it won't get past the declarations section. The module is only called by manually executing a macro, which contains just the command to run the module. Could I have done something elsewhere in the program that caused it to stop running? Thanks for your help
Option Explici
Option Compare Databas
Private Sub Mod_AM_Rpt(
Dim A, C As Intege
Dim stDocName, stQueryName, stCriteria As Strin
Dim stMsgSubject, stMsgText As Strin
stDocName = "Account Manager Report
stQueryName = "Account Manager Query
'Close report just in case it was left open by an incomplete proces
DoCmd.Close acReport, stDocNam
stMsgSubject = "Account Manager Project Tracking Report
stMsgText = "Dear Account Manager," & Chr(10) & Chr(10) &
"Please double-click the attached snapshot file to view your Account Manager Project Tracking " &
"Report. If you cannot open the report, click on the link below to download and install the free " &
"Snapshot Viewer. This one-time installation will enable you to view this and future reports. " &
"Please contact me if you have any problems or questions. " & Chr(10) & Chr(10) &
"http://www.microsoft.com/downloads/...3F-6D74-423D-8274-8B7E6313EDFB&displaylang=en
'Run report for every customer per Account Manager
For A = 1 To 5
For C = 1 To 1
stCriteria = "[AMNum]=" & A & "and [CustNum]=" &
If DCount("*", stQueryName, stCriteria) > 0 The
DoCmd.OpenReport "Account Manager Report", acViewPreview, , stCriteria, acIco
DoCmd.SendObject acSendReport, stDocName, acFormatSNP, Reports![Account Manager Report].[ACCOUNTMGR], , , stMsgSubject, stMsgText,
DoCmd.Close acReport, stDocNam
End I
Next
Next
MsgBox ("Finished sending Account Mgr reports."
End Su
Option Explici
Option Compare Databas
Private Sub Mod_AM_Rpt(
Dim A, C As Intege
Dim stDocName, stQueryName, stCriteria As Strin
Dim stMsgSubject, stMsgText As Strin
stDocName = "Account Manager Report
stQueryName = "Account Manager Query
'Close report just in case it was left open by an incomplete proces
DoCmd.Close acReport, stDocNam
stMsgSubject = "Account Manager Project Tracking Report
stMsgText = "Dear Account Manager," & Chr(10) & Chr(10) &
"Please double-click the attached snapshot file to view your Account Manager Project Tracking " &
"Report. If you cannot open the report, click on the link below to download and install the free " &
"Snapshot Viewer. This one-time installation will enable you to view this and future reports. " &
"Please contact me if you have any problems or questions. " & Chr(10) & Chr(10) &
"http://www.microsoft.com/downloads/...3F-6D74-423D-8274-8B7E6313EDFB&displaylang=en
'Run report for every customer per Account Manager
For A = 1 To 5
For C = 1 To 1
stCriteria = "[AMNum]=" & A & "and [CustNum]=" &
If DCount("*", stQueryName, stCriteria) > 0 The
DoCmd.OpenReport "Account Manager Report", acViewPreview, , stCriteria, acIco
DoCmd.SendObject acSendReport, stDocName, acFormatSNP, Reports![Account Manager Report].[ACCOUNTMGR], , , stMsgSubject, stMsgText,
DoCmd.Close acReport, stDocNam
End I
Next
Next
MsgBox ("Finished sending Account Mgr reports."
End Su