Re: Export to Specific Folder Based on Report Field?
- From: "SA" <~fake.address@xxxxxxxx>
- Date: Thu, 2 Jun 2005 08:54:06 -0400
Brook:
If you take a look at our PDF and Mail Library it can help you automate this
process, you'll find it on our web site in the developer tools area. To
determine if a file already exists, before you output it, you can use the
DIR vba command, then change the target output file name.
Hope that helps
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg
"Brook" <Brook@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BE211EAE-0968-4BE3-82B3-DD7BF5F855A4@xxxxxxxxxxxxxxxx
> 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
> 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
.
- Follow-Ups:
- References:
- Export to Specific Folder Based on Report Field?
- From: Brook
- Export to Specific Folder Based on Report Field?
- Prev by Date: Re: Recurring Parameter Prompt
- Next by Date: Re: Grouping multiple text boxes
- Previous by thread: Export to Specific Folder Based on Report Field?
- Next by thread: Re: Export to Specific Folder Based on Report Field?
- Index(es):
Relevant Pages
|