Hi,
I have created a simple database for generating quotes for our customers. I would like to have a button on a form that when clicked exports the current record to a .pdf. bringing up the "save as" dialog box with the filename to be taken from a textfield on the form called: QuoteNo. I do not want to automatically save the file to a location. So far i have the functionality but cannot get the save as box to have the correct filename (it defaults to the name of the report: Quote). I have spent some time browsing the forums and the only way i have seen it done is when the file is saved automatically in a specific path by using an [OutputFile] arguement, but i want to be able to choose where it's saved. My code thus far is below.
Thanks in advance,
Chris.
Private Sub butEXPPDF_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Quote"
strWhere = "[Quote Number]=" & Me.QuoteNo
DoCmd.OpenReport strDocName, acPreview, , strWhere
DoCmd.OutputTo acOutputReport, , acFormatPDF, , True
End Sub
I have created a simple database for generating quotes for our customers. I would like to have a button on a form that when clicked exports the current record to a .pdf. bringing up the "save as" dialog box with the filename to be taken from a textfield on the form called: QuoteNo. I do not want to automatically save the file to a location. So far i have the functionality but cannot get the save as box to have the correct filename (it defaults to the name of the report: Quote). I have spent some time browsing the forums and the only way i have seen it done is when the file is saved automatically in a specific path by using an [OutputFile] arguement, but i want to be able to choose where it's saved. My code thus far is below.
Thanks in advance,
Chris.
Private Sub butEXPPDF_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Quote"
strWhere = "[Quote Number]=" & Me.QuoteNo
DoCmd.OpenReport strDocName, acPreview, , strWhere
DoCmd.OutputTo acOutputReport, , acFormatPDF, , True
End Sub