Thursday 15 April 2010

How do I export a MS Access report to PDF with a formatted ID value as the report name? -


I am using Access 2007.

I have created a button that I want to know for my current invoice for a .pdf and in the name of it "invoice number plus client name" and i'm close but not yet it is currently The code exists and it works fine:

  Personal sub Create_Document_Click () DoCmd.OutputTo acOutputReport, "Invoice", acFormatPDF, [Invoice_ID] & amp; "_" & Amp; [Client_id] & amp; ".pdf" and sub   

This gives me a report called "1_1.pdf" which is called "1007735001_XYZCompany.pdf".

In my invoice table, I have formatted the invoice_ID field, which is an auto number field, "1007735" 00 but the report records the output as 1 as the formatted number, I First we need to know if I can change it to show this formatted value. Is this possible?

Then I would like to know that I can change client name from 1 to client name. My field name is Client_ID and Client_Name and the table is called Client.

I have searched through many forums and have tried many solutions but all have given me errors, any help would be greatly appreciated. Please tell me if I need to give more information.

You have committed many sins. You should not add formats to tables, as you have found, the format is just one format, this does not change the content of the field (). In the editor, you have a look for client ID, another anti-feature () Has added up

You will need to see the client again and reformat the number.

  Customer = DlookUp ("ClientName", "ClientTable", "ClientID =" & [Client_ID]) Invoice = Format ([Invoice_ID], "" "1007735" "000") FileName = Invoice & amp; "_" & Amp; Customers & amp; ".pdf"    

No comments:

Post a Comment