Here is the solution, there is a built-in function to export data into many formats in Access VBA. Following sample will be helpful you to customize and use your way.
DoCmd.OutputTo acOutputTable, “Employees”, acFormatPDF, “Employee.pdf”, True
Here you can use doCmd.outputTo function to export table (acOutputTable), query (acOutputQuery), forms (acOutputForm) or report (acOutputReport) into many formats. In my example I am going to export a table employees table and convert into PDF format.
Following is the basic expression of outputTO function.
OutputTo (“Object Type”, “Object Name”, Output Format, Output File Name/Path, Auto Start True or False, Template File if Need, Encoding If need true or False, Output Quality)
So you can use this in a VBA function.
Sub OutputPdf (item As String, cont As String)
DoCmd.OutputTo acOutputTable, “Employees”, acFormatPDF, “Employee.rtf”, True