I am trying to create an IF statement on my export button so that it will Export to PDF or Excel. It just reverts to PDF everytime. Help
Private Sub Command36_Click() Dim LResponse As Integer LResponse = msgbox("Do you wish to export to Excel? If Yes, click Yes, if No, export will be a pdf file", vbYesNo, "Continue") If Response = vbYes Then DoCmd.OutputTo acOutputReport, "rptCAQ1", acFormatXLSX, , True Else DoCmd.OutputTo acOutputReport, "rptCAQ1", acFormatPDF, myreportoutput, , , , acExportQualityPrint End If End Sub



Reply With Quote
