Wayne Cramer
Registered User.
- Local time
- Today, 15:37
- Joined
- Aug 10, 2007
- Messages
- 93
I have an array module which opens a report and sends vendor report cards (245) as RTF files to a folder. The reports are based on the vendor name. All was going well qwhen the client decided that the file name needed to use the vendor number vs the vendor name. The vendor number is a field in the report "Report Card YTD" called Vendor No (Yes, I know it should not have spaces but I inherited this). Is there a way to include this Vendor No field to make the file anme use the Vendor No instead of the Vendor Name? Everything I try I get an External Name Not Defined error.
Function SendRTFAutoMonthYear()
On Error GoTo Err_Command0_Click
Dim strSQL As String
Dim strFileName As String
Dim cVendorArray(241)
Dim cVendorName
DoCmd.OpenReport "Report Card YTD", acViewPreview, , strSQL
strFileName = cVendorName & "_" & Year(Date) & Format((Month(Date) - 1) & "/1", "MM") & " _ " & "Sourcing" & ".doc"
DoCmd.OutputTo acOutputReport, "Report Card YTD", acFormatRTF, "H:\SUPPLY CHAIN\Report Cards\4 Report Card 2008\RTF Report Cards\" & strFileName, False
DoCmd.Close acReport, "Report Card YTD"
Function SendRTFAutoMonthYear()
On Error GoTo Err_Command0_Click
Dim strSQL As String
Dim strFileName As String
Dim cVendorArray(241)
Dim cVendorName
DoCmd.OpenReport "Report Card YTD", acViewPreview, , strSQL
strFileName = cVendorName & "_" & Year(Date) & Format((Month(Date) - 1) & "/1", "MM") & " _ " & "Sourcing" & ".doc"
DoCmd.OutputTo acOutputReport, "Report Card YTD", acFormatRTF, "H:\SUPPLY CHAIN\Report Cards\4 Report Card 2008\RTF Report Cards\" & strFileName, False
DoCmd.Close acReport, "Report Card YTD"