Macro - Print To Adobe PDF File And Save As Database Name

Dec 16, 2004

Using Access 2000, I have a macro to generate a report by updating various make-table queiries. I would like for the macro to print the report to an Adobe PDF file and save the file as the database name.

When I manually print the report, it gives me the opition of selecting printers and Adobe PDF is listed as a printer. After selecting the "printer", a "Save As PDF" menu pops up and currently it lists the Access Report Name. I would like to use the database name as the name of the PDF file.

In short, when I execute the "Generate Report" macro, I want the end product to be a PDF file using the database name as the PDF file name.

View Replies


ADVERTISEMENT

Print Out Macro Action - Prompt To Save As

Sep 21, 2011

Why when I set up a macro with a PrintOut action does it always prompt me to "Save As" before it prints? I have a default printer set up in the system, but it still asks to "Save As." It does print after.

View 1 Replies View Related

General :: Open Save File Dialog - Select File From Text Box And Save To Selected Location

Aug 8, 2013

I need code for save dialog file ,and select the file from textbox and save it to the selected location.i have only this code and i dont know what else i can do with this because it just opens the save file dialog !

View 1 Replies View Related

Attaching WP, Excel, Adobe Files To An Access Database Form Using A Control Key

Oct 18, 2006

Is it possible to attach a WP, Excel, or Adobe file to a form, possibly by using a control key? How?

View 6 Replies View Related

I Want To Print A Report And Programmatically Set The Printer Name And 'Print To File

Jul 16, 2007

How can I print a report and at the same time programatically set the printer name and 'Print to File' option and set the path of this option?

View 1 Replies View Related

Print Macro

Jul 19, 2006

I made a print macro to print records from a subform.



The problem is, it prints all the records in the subform that are not visible aswell. I did a search for records with TSA in it and it shows 3 records. These are the only records I want to print.

The code I use at the moment looks like this:

Code:Private Sub Print_Click()On Error GoTo Err_Print_Click Dim stDocName As String Dim MyForm As Form stDocName = "frmSubform" Set MyForm = Screen.ActiveForm DoCmd.SelectObject acForm, stDocName, True DoCmd.PrintOut DoCmd.SelectObject acForm, MyForm.Name, FalseExit_Print_Click: Exit SubErr_Print_Click: MsgBox Err.Description Resume Exit_Print_Click End Sub

View 6 Replies View Related

Print Report By Macro

Aug 16, 2007

Is there a way to print a report from a form by using VBA or a macro? If so how can this be done?

View 1 Replies View Related

Forms :: Macro To Save New Records?

Jun 19, 2013

I've created a macro for saving records, but it's just over write on the previous record, what's the best way to save new records using forms?

View 2 Replies View Related

Create Macro Save Report As PDF

Sep 17, 2011

I want to be able to have a report automatically generate at the beginning of each month and save it as a PDF file and have that report saved to my access database.

View 3 Replies View Related

Can I Disable Print Macro Def When Using Printout

Sep 15, 2005

here's my macro



after each print out line i get this



can i disable this prompt from appearing?

View 1 Replies View Related

Modules & VBA :: Print Linked Doc From Macro

Jun 17, 2015

I'm working in 2003 (still) and have a macro to print the selected form the user has on their screen. I need this same macro to also print a PDF in a particular network folder or just exit if the PDF doesn't exist. I've tried RunSQL with "PrintDoc [Link2PDF]" as the argument. I've tried RunApp with "Acro Rd32.exe /t [Link2PDF]" as the argument but neither one works. The RunApp line will open the Adobe reader but nothing more.

View 4 Replies View Related

Tables :: Print Labels Macro - VBA

Jan 28, 2014

I have an Access database that includes a customer listing. My client would like me to include a button on a form that prints off all of their customers' names and addresses onto mailing labels. I know how to do it manually by clicking on the Customers table, clicking Labels under the Create ribbon, selecting the fields, selecting the label manufacturer, size, etc. etc., but the customer would prefer to have just one single button.

I've looked everywhere for VBA code to put into a macro that does this. Unfortunately, unlike Excel, Access doesn't have a "Record Macro" option so I can attach it to the button.

Table: Customers
Fields: FirstName LastName Address City State Zip (There are other fields, but they are not relevant to printing address labels)

View 1 Replies View Related

Modules & VBA :: Save As Dialog Box - Allow User To Save Copy Of Current Database At Desired Location

Feb 12, 2014

So I have this relatively simple problem: I need to create a button that once clicked will open the Save As dialog box and allow the user to save a copy of the current database where he wishes. The filename should contain todays date in DDMM format along with some pre-set text e.g. DDMM PresetText.

I am using Access 2010.

View 2 Replies View Related

Print Multiple Copies Of A Report Using Macro

Jan 7, 2015

In Access 2007 is it possible to alter a macro so I can print 2 copies of a report. I have created a simple macro which opens up a report based on a value in a data entry form. I want to automatically print 2 copies of the report. Is this possible....

View 1 Replies View Related

Modules & VBA :: How To Print Specific Report With PrintObject In Macro

Feb 13, 2015

Actually I need to select printer before printing report. That's why I need to call printer dialog to select printer using "PrintObject" in macro. But it's print the form not report. I need to print a specific report.

View 1 Replies View Related

Reports :: Save Report As PDF - Output To Action Cancelled With Access VB Macro

Jan 12, 2015

One of the users of my application, reports an error when saving a report to pdf by VBA code. She’s using Access 2013, on Windows 8.1.

The error is “error 2501 output to action was cancelled with access vb macro”

The VBA code is

StrReport = “RepInvoice”
StrDocumentName = “C:UsersMaryDocumentsAccessInvoice.pdf”
DoCmd.OpenReport StrReport, acViewPreview
DoCmd.OutputTo acOutputReport, StrReport, "PDFFormat(*.pdf)", StrDocumentName, False
DoCmd.Close acReport, StrReport, acSaveNo

This error occurs at the OutputTo line. This code is part of an user form with a button “save as PDF”.
When this code is run, the report is visible as an example (as meant to be) on the screen. The code stops at the OutputTo line.

When I use
DoCmd.OutputTo acOutputReport, StrReport, acFormatPDF, StrDocumentName,, False
the problem still exists.

I tried to save the report manually by Preview > Export > PDF. The preview is OK, saving as PDF results in the same error 2501. This may lead to the conclusion that this problem is not caused by the VBA code.

I verified whether user write rights are OK, and whether a default printer is available. Both are OK. The report consists of 1 page.
When this very same application is used with Access 2010, everything functions as expected.

View 8 Replies View Related

Save Record And Create Print Preview With Same Button On A Form?

Apr 8, 2014

In Access I have created a button to print a preview prior to printing document it is entitle "NoVeteranMain" which works fine. Except I want it to save my document prior to printing preview how would I do it. If not after I edit it I have to re-save it prior to hitting button which generates print preview.

This is code that is generate upon click

Private Sub NoVet_Click()
DoCmd.OpenReport "NoVeteranMain", acViewPreview, , "ClientID = " & Me.ClientID
End Sub

View 5 Replies View Related

Opening A File With A Macro

Sep 8, 2005

Is it possible to open an Excel FILE using a macro, if so could someone shed some light on this? I know how to open Excel itself using RunApp but it doesnt work with files.

Any help would be appreciated
Cheers all

Bikeboardsurf

View 1 Replies View Related

Save File?

Feb 9, 2008

Hi guys, little question.

I really like Access, I can manage well with it. But I have a problem, and I really wonder why this kind of thing happens in such a professional program using a lot of important data.

Actually the program saves automatically, and I don't like it. For example I try a little something, delete some stuff, replace by something else, and when I quit the program, it doesn't say a thing, and when I come back, the unimportant stuff I changed is still there, and what was replaced is lost. Why? Is there any way to force the program to ask if I want to save the changes?... It's really annoying and I really don't feel secure with my data with this system.

Thanks for your clues! :)

View 14 Replies View Related

Need To Close An Open File Before A Macro Runs.

Nov 28, 2007

I need to find a way to close a file (spreadsheet) if it was left open by a user before my scheduled macros need to delete and remake that file to update it. Is there a way to do this in Access? I've been looking for scripts everywhere... Any help is greatly appreciated. Thanks, Rick.

View 1 Replies View Related

Can't See Specs When Trying To Import Text File Via Macro

Oct 23, 2014

I am trying to complete a macro that starts with importing of a text file. However, when I go to complete the steps in the macro, I do not see the specs for the import file that i created. There is a dropdown with a few specs for me to choose from in the box titled "Specification Name" when I am completing the action titled ImportExport Text. However, none of those specs are the right ones.

When I go to "Saved Imports" I can plainly see the import that I am interested in. So is a Saved Import different than a spec? If so, what steps do I need to do to create the spec?

View 1 Replies View Related

Save Snapshot As File

Mar 22, 2007

Hello,
I am using a useful function to save data of a form using the snapshot utility. I open the form, add or change data and sent the form to other users via e-mail. The snapshot uses a report. The code to do this is the following:

Me.Refresh
DoCmd.SendObject acReport, "EmailmyForm", "SnapshotFormat(*.snp)", "", "", "", "Action Required", "Please take action on the attached case.", False, ""

I was now thinking if it is possible to save the shapshot report as a file directly into a selected folder on my S drive (ex. S0000abmyfolder. I will need that the file is automatically named for my with the SSN present on the form.

Any idea or help? Thanks.

View 12 Replies View Related

Adobe PDF?

Aug 8, 2006

Is there a way to output a single record from a form not report as an Adobe PDF automatically?

View 2 Replies View Related

Automatic Import Of Multiple CSV File In Access With Macro

Jan 11, 2012

I need to import 15 csv files into access every month. I have location of all those files listed in a table in the same access DB but i'm not sure how to incorporate them in a macro I have written to import one of those files:

Function Macro_TransferCsvFileTo_RatesTradeData()
On Error GoTo Macro_TransferCsvFileTo_RatesData_Err
DoCmd.TransferText acImportDelim, "Import_Spec_tbl_RatesData", "tbl_RatesData", "c:Documents and SettingsaggauraDesktopWIPXMLDB_JOH_FI_2011123 0.csv", True, ""

[Code] ....

where c:Documents and SettingsaggauraDesktopWIPXMLDB_JOH_FI_2011123 0.csv is the file name I want to be replaced by each of the file listed by me in the other access table.

View 3 Replies View Related

Print Excel File

Dec 6, 2005

Hello, I'm back again.

I have this form with an button on it, but I like to know how to use the button for printing an Excel file.

Tnx,

Dinus.

View 4 Replies View Related

Print Recordset To File

Sep 28, 2005

hi guys,

i'm trying to run a recordset and export the string of each record into a txt file. from all the examples ive seen the way i'm doing it is right but i'm not getting any data to go into the actual file. my loop works perfect (as i watched it in debug mode) and it makes the string, my file just isnt getting outputted.

heres the code:

Private Sub btneParcel_Click()

Dim rs As Recordset
Dim strContents As String
Dim lngFileNum As Long
Const strFileName = "g:worksdatImport01.txt"

Set rs = CurrentDb.OpenRecordset("SELECT * FROM QryeParcelExport")
If rs.RecordCount > 0 Then

'header lines
strContents = "ISA*" & Format(Now, "yyyymmdd") & "*" & Format(Now, "hhnnss")
strContents = strContents & vbCr & "GS*CN"

Do While Not rs.EOF
'detail
strContents = strContents & "ST*"
strContents = strContents & vbCr & "CN*" & rs("EntryDate") & "*" & rs("EntryTime") & "*E*" & rs("CustId") & "*" & rs("CustName") & "*" & rs("CustAddr1") & "*" & rs("CustAddr2") & "*" & rs("CustAddr3") & "*" & rs("CustCountry") & "*" & rs("CustPhone") & "*" & rs("ChargeAcctNo")


rs.MoveNext
Loop

'footer
strContents = strContents & "GE*8"
strContents = strContents & vbCr & "IEA*36"


lngFileNum = FreeFile
Open strFileName For Output As #lngFileNum
Print #lngFileNum, strContents
Close #lngFileNum

MsgBox "Client Data has been successfully exported to G:Import01.txt", vbExclamation


End If

End Sub

anyone able to help with this? actually just reading my code, do i need another new line at the end of my string? think parts are going to one massive line that should be seperate lines...but that should still output something.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved