For Next Issue

Dan,

I have attached the database. Let me know what you find, and thanks again.
 
Last edited:
Works :)
Code:
Private Sub Command4_Click()
    'Macro to export data for reports
    
    'Turn off Warnings
    DoCmd.SetWarnings False
    
    'Determine and set the path for the database location
    Dim Path
    
    Path = Application.CurrentProject.Path
    
    Dim PMOLead(1 To 8)
    
    PMOLead(1) = "abc1"
    PMOLead(2) = "abc2"
    PMOLead(3) = "abc3"
    PMOLead(4) = "abc4"
    PMOLead(5) = "abc5"
    PMOLead(6) = "abc6"
    PMOLead(7) = "abc7"
    PMOLead(8) = "abc8"
    
    
    For i = 1 To 8
        
        txtPMOLead_Box = PMOLead(i)
        Call txtPMOLead_Box_AfterUpdate
        If LeadEmail.Value <> vbNullString Then
        
            DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "PastDue", Path & "\YTD Past Due_" & PMOLead(i) & "_" & ".xlsx", True
            
            'sendemail
        End If
        
    Next i
    
    'Notify completion
    MsgBox "Export Complete", vbOKOnly, "Export Notification"
    
    'Turn on Warnings
    DoCmd.SetWarnings True
End Sub
 
YES!!!!!!

Thank you Dan!!!

That was it, the Call piece. I really didn't think it was possible. :D

I really appreciate the time you took to help me on this.

Cheers!
Cris
 
Your welcome, any time :)

Now for some advice.

The way you are doing that is absolutely horrid!

For this, or your next project:
Promise me you will sit down and draw out a plan on how you are going to piece your program together.

Practice makes perfect!

Regards,
BlueIshDan
 

Users who are viewing this thread

Back
Top Bottom