68
« เมื่อ: 05 พ.ค. 64 , 13:14:28 »
สังเกตุเห็นว่าท่านใช้ชื่อตัวแปล FilePath เดียวกันมันก็ถูกแทนที่นะครับลองแก้แล้วทดสอบดูครับ
FilePath1 = "Z:\bills64\suzu64\IV\" & Filename & ".pdf"
FilePath2 = "d:\bills-suzu\INV\" & Filename & ".pdf"
DoCmd.OpenReport "ใบกำกับ 7_1", acViewPreview, Filename
DoCmd.OutputTo acOutputReport, "ใบกำกับ 7_1", acFormatPDF, FilePath1
DoCmd.OutputTo acOutputReport, "ใบกำกับ 7_1", acFormatPDF, FilePath2
หรือไม่ก็แบบนี้
FilePath = "Z:\bills64\suzu64\IV\" & Filename & ".pdf"
DoCmd.OutputTo acOutputReport, "ใบกำกับ 7_1", acFormatPDF, FilePath
FilePath = "d:\bills-suzu\INV\" & Filename & ".pdf"
DoCmd.OpenReport "ใบกำกับ 7_1", acViewPreview, Filename
DoCmd.OutputTo acOutputReport, "ใบกำกับ 7_1", acFormatPDF, FilePath