G
Guest
Good Day,
I have an orders form that I use for two types of orders: Custom &
Program, after an order is input, I click a button that prints my order form
& saves it to a specified folder. However at this point all my order forms go
to one folder. I would like to have it set up so that if it is custom order
it is saved to C:\Custom Orders and if it is a Program Order it is saved to
folder C:\Program Orders.
Also, I would like to have the code set up so that if the the file name
already exist, it won't overright the file, but add a new file with an added
extension of some sort? I.E. if the file is CustomOrder_08 and I tried to
export the same order form again it would add an extension like
CustomOrder_08_1 and so on... Any ideas? suggestions?
IF anyone has any ideas on how to incorporate the ability to save as a PDF
please let me know... I have Adobe Acrobat Professional.
Thanks,
Brook
Below is my current code:
Start Code:
Private Sub cmdPrintPreview_Click()
Dim strReportName As String
Dim strCriteria As String
Dim strOutputName As String
Me.Dirty = False
If NewRecord Then
MsgBox "This record contains no data. Please select a record to
print or Save this record." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptcustomorders"
strCriteria = "[orderid]= " & Me![orderid]
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then
strOutputName = "D:\Karma Imports\Program & Custom Orders\Custom
Orders\" & (Me!ordnum) & " - " & Format(Date, "mm_dd_yyyy") & ".snp"
If Me.PrintOrder = False Then
Me.PrintOrder = True
Me.SystemPrintDate = Date
End If
DoCmd.OutputTo acOutputReport, strReportName, acFormatSNP,
strOutputName, True
End If
End If
End Sub
End Code
I have an orders form that I use for two types of orders: Custom &
Program, after an order is input, I click a button that prints my order form
& saves it to a specified folder. However at this point all my order forms go
to one folder. I would like to have it set up so that if it is custom order
it is saved to C:\Custom Orders and if it is a Program Order it is saved to
folder C:\Program Orders.
Also, I would like to have the code set up so that if the the file name
already exist, it won't overright the file, but add a new file with an added
extension of some sort? I.E. if the file is CustomOrder_08 and I tried to
export the same order form again it would add an extension like
CustomOrder_08_1 and so on... Any ideas? suggestions?
IF anyone has any ideas on how to incorporate the ability to save as a PDF
please let me know... I have Adobe Acrobat Professional.
Thanks,
Brook
Below is my current code:
Start Code:
Private Sub cmdPrintPreview_Click()
Dim strReportName As String
Dim strCriteria As String
Dim strOutputName As String
Me.Dirty = False
If NewRecord Then
MsgBox "This record contains no data. Please select a record to
print or Save this record." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptcustomorders"
strCriteria = "[orderid]= " & Me![orderid]
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then
strOutputName = "D:\Karma Imports\Program & Custom Orders\Custom
Orders\" & (Me!ordnum) & " - " & Format(Date, "mm_dd_yyyy") & ".snp"
If Me.PrintOrder = False Then
Me.PrintOrder = True
Me.SystemPrintDate = Date
End If
DoCmd.OutputTo acOutputReport, strReportName, acFormatSNP,
strOutputName, True
End If
End If
End Sub
End Code