title: How do I export a MS Access report to PDF with a formatted ID value as the report name?
body: <p>I am using Access 2007. </p>
  
  <p>I have created a button that allows me to output my current invoice to a .pdf and I want it to be named by "invoice number plus client name" and I am close but not quite there yet. This is the code I currently have and it works fine:</p>
  
  <pre><code>Private Sub Create_Document_Click()
  
      DoCmd.OutputTo acOutputReport, "Invoices", acFormatPDF, [Invoice_ID] &amp; "_" &amp; [Client_ID] &amp; ".pdf"
  
  End Sub
  </code></pre>
  
  <p>This gives me a report called "1_1.pdf" what I would like it to be called is "1007735001_XYZCompany.pdf". </p>
  
  <p>In my Invoices table I have formatted the Invoice_ID field which is an auto number field as "1007735"00 but outputing the report names it as 1 instead of the formatted number, I would first like to know if I can change this to show the formatted value. Is it possible?</p>
  
  <p>I would then like to know how I can change the client name value from 1 to the client's name. My field names are Client_ID and Client_Name and the table is called Clients.</p>
  
  <p>I have searched through several forums now and tried many solutions but all have given me errors, Any help would be greatly appreciated. If I need to give more info please let me know.</p>