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.
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.
I am trying to open a form with a specified record using double clicked event (list box) but access is throwin "The OpenForm action was cancelled". My code is:
Private Sub lstSchool_DblClick(Cancel As Integer) Dim test As String Dim thisForm As String
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.
:confused: Anyone know how to trap/prevent the msg "The DoMenuItem action was cancelled" after answering no to deleting a record? I followed the instructions at the following thread but no luck:
---------------------------------- Private Sub Delete_Click() On Error GoTo Err_Delete_Click DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70 Exit_Delete_Click: Exit Sub Err_Delete_Click: MsgBox Err.Description Resume Exit_Delete_Click End Sub
----------------------------------- Private Sub Form_Delete(Cancel As Integer) DoCmd.SetWarnings False If MsgBox("Are you sure you want to delete this record?", vbYesNo) = vbNo Then Cancel = True Else MsgBox "Record deleted!" End If End Sub -------------------------------------
I have several reports that creates price sheets for all of my customers. It is a report with multiple subreports within, and I am trying to create a process to seperate them and export them all into [Customer Name].pdf. I have tried to scrap some code together from various forums, and it has been unsuccessful.
For example, one of the reports "rptPriceSheetQuarterly", has a field "txtCustomerName", that feeds the queries for the other subreports. I would like to create a new PDF when that field changes.
I understand I need some sort of looping code that will cut the report up dump them all into one folder, but I am totally out of my element here.
I have been tasked with creating a database to log employee suggestions and then automatically present reports around the site. I have developed the database and it works OK and can output *.PDF reports, but I'm having problems with how to display these reports. My idea was to output the reports automatically as *.TIFF or *.JPG files and have them stored in a folder that the My Pictures screensaver uses. The reports (in fact, any site report stored in this folder) can then be shown on any screen dotted around the site when it goes into screensaver mode. However I can't find any way to output/convert to a picture file.
The other option is to create a webpage that rotates through the saved PDFs, but this isn't ideal as the PC users will have to load the webpage to display the reports.
I have a few selected reports on an Access 2007 database that users can run. Is there a way for users to view the report, save as a PDF and automatically save a copy to a shared drive by modules/vba coding as an On Click event procedure?
I need to know if exist the system in Access 2007 to output a report in word document including images. Normally the output is "*.rtf", with a quite good quality but due to the file type it doesn't include the pictures.
What I want to do is save a daily report to a map source, each day the map name changes so for today the map name is "Report2013-10-03", and tomorrow the map name will be "Report2013-10-04".
Is this possible? is there some function like save(Report%s) where %s = date() ?
I want to sent out my report as a pdf file with my macro.. I've been trying to use the VBA
Code: Option Compare Database
Sub Fix1() DoCmd.SendObject acSendReport, "MarketRiskControl_HighestDiffs_AsOfCurrentDate", "PDFFormat(*.pdf)", "my mail@mail", "cc", , "SD Counterparty Report as of Current Date", "Regards, Trading Risk Control", False End Sub
Is it possible to save a report as a pdf but give it a specific name on the click of a button? example if user presses a button the report will be saved as a pdf but the name of the pdf will be made up of two of the text boxes on the report. txtbx1 = "hello" txtbx2 = "123" name of pdf will be hello123...
I have inserted a function via a module at the beginning of a Macro using the RunCode action:
Function Msgbox_Yes_No() Dim Response As Integer Response = MsgBox(prompt:="Select 'Yes' or 'No'.", Buttons:=vbYesNo) If Response <> vbYes Then End If End Function
However, it doesnt stop the macro from continuing on its way to delete a load of records if the user chooses no.
I want to run a macro which is having three action queries from the another database when i click the button from my current database. I am using Access2010.
I have a database with which I use to generate reports as pdfs to load to a website.
However when I go to save the file as a pdf it is always as the report name.I am trying to automate this by using a macro as I need to run a report 50 times for ships with a different parameter each time (name of the ship) Another report needs to be run about 30 times, this time the parameter being a date And finally two other reports, but I can live with those being the name of the reports.
Firstly can this be done?
Secondly which would be the best way?
I've tried using the macro route by I run my Report "Main_Ship" with a where clause of [ship]="wiltshire". This produces the report with the relevant ship, but I am then unsure what to use next to save it as a pdf with the name "wiltshire" using the macro route.
or
Create a VBA routine that runs the report as many times as required each with a different parameter for the name of ship or date.?
I am facing an issue The Custom Macro Stopped report from rendering. I have report which is having two sub reports inside. The report is opening in the report view properly but when the ExportWithFormating macro runs, it throws this error.
I have a form where user can chose his own criteria for the report, like time period, ppl involved and other parameters. i open report filtered with these conditions. I also create a nice text (as public variable) bout what where the search criteria and put it in the header/footer. Then I export the report as xls file. it's nicely saved as column names and data, just what i need.how to add a field that would store the criteria, ie that string public variable that has it all neatly explained?
I have a Macro setup and SendObject is one of the Actions. It is setup to send an existing report. Is there a way to insert a fieldname from that report into the Subject line of the e-mail that is sent? That would be great, instead of having the same subject line for every e-mail, using the date or something like that. Please let me know. Thanks.
I am building a purchase requisition (PR) database.
The tables are (simplified) as follows:
Table1 - tbl_PRList - contains only 3 fields with one of these fields being the "PR No". Table2 - tbl_PRData - contains all the item data, also with a field "PR No".
The intent of the "item entry" form is to add items to the latest PR that has been generated.
So, whenever an item that is to be placed on the new PR, you type in the item description, qty, etc in the form and then you press a button that saves this item to the main 'data' table (Table1). What I would like to do is, "on click" of this button, I'd like this record, prior to it moving to the next record, to set the value of the PR No field in Table 1 to be the same as the DLast value of the Table2 table.
My reports are saved as a PDF at the moment I click the print report button, select cutePDF Writer then manually add the Quote number stored in Field from the Table or form into the file name, then select the location to store the PDF file
Can I make this process automated when I click the print report button to auto select PDF Print, then auto populate the file name with the quote/Inv Number and then save to nominated directory.
I want to save my report as excel file on the user computer with a click of a button. I have tried this code:
Private Sub Cmd_ReporttoExcel_Click() DoCmd.OutputTo acOutputReport, "Gastrolog Report", acFormatXLS, "C:UsersXXDocuments" & Format(Date, "yyyymmdd") & ".xls" End Sub
But it is giving error 2282 - The format in which you are attempting to output the current object is not available.
The other part of this question is :
This is something similar when I didn't have "PDF add in " in access 2007, when I added PDF add in then option to save file in PDF was available in "output to" action of macro. There is nothing like excel add in. However when I can export the data in excel sheet by Export function in access why don't I have option to save file as excel in "output to " action in macro? I want to have this option so that user can click a button in the form rather than in the top ribbon try to find out how to transfer and save the excel sheet.
Recently I am getting this message in a database that would allow users to add new rows to tables, even when I look into the tables themselves I can't seem to enter data
Would anyone know what could be causing this error?