This can be easy with Access 2007 (see note below) or later.
Open your report using the WhereCondition
parameter to limit the record source to a specific customer.
DoCmd.OpenReport "rptFoo", acViewPreview, , "Customer_ID = 1"
Then use OutputTo to save it as PDF with a file name you supply.
DoCmd.OutputTo acOutputReport, "", acFormatPDF, "Spacely_Sprockets.pdf"
Close the report afterward.
DoCmd.Close acReport, "rptFoo"
You could create a procedure which opens a recordset for Customer_ID
and Customer_Name
data, then use those 3 commands with values from each row.
If your Access version is older than 2007, you'll have to tell us about the method you're using to create PDF files.
Note: For Access 2007, Office Service Pack 2 provides Built-in Save As PDF/XPS support.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…