I am a novice still when it comes to some of the programming and got help from this group before so I'm hoping you can help me again. In my previous requests the group helped me create my invoices and store them in a shared folder. It's been working perfectly! I've built the code so I can send reminders to those that are still outstanding but I've had to attach the previously made pdfs by hand. In the beginning this isn't a huge deal but as you continue to get outstanding invoices this practice isn't something I want to keep doing. I'd love to be able to program so it just goes into the location where they are stored and attach to the reminder emails. I'm sure there are ways and I'm just not able to complete it.
I don't know if you need to see all the components but this is where I am attempting to identify the invoice:
__________________________________________________ _______________________________________________Private Function AddInvoicePDF(sInvoice As String, StudyID As Long) As String
Dim AddInvoice As String
Dim Criteria As String
AddInvoice = "M:\Programs\0.BillingReportsandInvoices\0.Invoice sPendingApproval" & sInvoice & ".pdf"
Criteria = "[Study ID]=" & StudyID
End Function
__________________________________________________ _______________________________________________
And here is where I was trying to attach to the email:
__________________________________________________ _______________________________________________
outMail.Attachments.Add AddInvoicePDF(rs("[Invoice #]"), rs("[Study ID]"))
__________________________________________________ _______________________________________________
Now if I over over the rs("[Invoice #]") and rs("[Study ID]") the Invoice# is showing (without the .pdf indicator for a file name) and the Study ID is showing properly. However it's throwing a "Path does not exist. Verify the path is correct" error. Since these invoices can cross multiple criteria's I do not wish to have it create a new invoice each time but pull from the original location. Is there a way that I can accomplish what I want?
Thanks!
Sandra