Save Report As PDF - Adding Date Retrieved From Query As Part Of File Name

Nov 6, 2012

I'm trying to save a report to my Desktop as a pdf - adding a date {that I am retrieving from a query} as part of the pdf file name.

I get a
Run-time error '2501' - The OutputTo action was cancelled.
(See screenshot).

Here's the code I'm using. So far - all I've tried to do is run the function from the Visual Basic Editor.

Function SaveReport()
Dim strSQL As String
Dim strPath As String
Dim strFilename As String
'Get the ReportDate.

[Code] .....

View Replies


ADVERTISEMENT

Newbie Date As Part Of File Name

Mar 22, 2008

Everything works great but I want to save the backup file with a unique name, like EX: myfile INTx.xls where intx = the date "Now", maybe, am I looking at this wrong.
Thanks Bob

View 12 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

Trying To Save Report To Specific File

May 12, 2005

DoCmd.OutputTo acOutputReport, "MD Form",".xls" "C:Documents and SettingsKevanAlderton.THERMOSHIELDDesktop", True


any ideas what is wrong ??

many thanks

View 3 Replies View Related

Reports :: Save Report As PDF And Auto Populate File Name

May 8, 2013

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.

View 6 Replies View Related

Reports :: Unable To Save Report As Excel File

Jul 19, 2015

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.

View 3 Replies View Related

Modules & VBA :: Save Report As PDF Using Specific Fields To Create Name Of File

Jun 2, 2015

I want to create a Macro saves the report in a specific location, and uses two fields within the report to generate the name of the file. For example, "[Sales Rep Name] + [PayPeriod].pdf" and it should be saved in a predetermined folder.

View 1 Replies View Related

Modules & VBA :: How To Publish And Save Each Record Report In Separate File

May 24, 2014

Trying to make this code work, don't know how to filter as it prints identical all reports.

Private Sub cmdExportPDF_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim MyPath As String
MyPath = "C:Reports"
If Len(Dir(MyPath, vbDirectory)) < 1 Then
MkDir (MyPath)

[code]....

View 14 Replies View Related

Modules & VBA :: Save NOW (Date And Time) Into Event Log File

Oct 16, 2014

I want to save NOW() (i.e. Date and time) into an event log file. But I just cannot work out the syntax. My insert statement works fine without the date field in, but fails on a syntax error (3134) when I include it.

strsqlac = "INSERT INTO EventLog ( EventTime, User, EventType, EventMessage, DocRef, AutoSeq, CoCode ) " & _
" Values ( '" & Now() & "', '" & GlobUser & _
"', '" & Mess2 & _
"', '" & Mess1 & _
"', '" & Docref & _
"', " & AutoSeq & _
", '" & CoCode & _
"' );"

... it's the first column, EventTime that is the issue. I have tried several different ways of wrapping it in the VALUES () without success.

My database field EventTime is defined as a General date which Access 2007 tells me will give me date and time. That's what I want.

The Value formats I have tried (currently showing as 'NOW()' above, are ...

#NOW()#
#'NOW()'=
'#NOW()#'
and (as I say) 'NOW()'

View 5 Replies View Related

Date Problem - Part Constant - Part Now()

Nov 3, 2006

Hi everyone,

I have refined my query from previous threads to involved a module function. This calculates more acurately no of working days between dates and takes into account a holidays table. (All credit to Arvin Meyer on the module:) )
However because the Leave Year starts at the 1 July and finishes 30 Jun I need to compose the date for any current year Year(Now())

Enclosed scrdmp shows my query design. I can easily get it to work as you see it, but obviously as each year rolls over, the year needs to change.

Have looked at many posts but can't find what I'm looking for. This one will get me over the hurdle.

Many thanks,

View 6 Replies View Related

How Do I Get Out Part Of A Date In A Query??

Jul 17, 2007

Hey People,

Is it possible to take out part of a date in a query and put it into a new column, e.g.

if one field is : "Date"... with entries such as 12/05/07.. etc,

is it possible to have another column "Month" that has the specific month in the date column.. e.g the one above will have "May".......

anyone have any idea about this...

cheers.

View 5 Replies View Related

Reports :: Adding Images To A Report - Only File Path Displaying

Oct 15, 2014

I have to add 2 company logos and a phone graphic to a report.

I can only seem to add one logo and if i try to copy and paste a graphic it just displays the file path.

View 3 Replies View Related

How To Export A Query To Save As A .CSV File

Sep 1, 2005

This question has 2 parts.

The first part is

Is it possible to export a query so it wil save as a .CSV file?

Second Part

Is it possible to have this report run automaticaly every day?

Thanks for your help in advance!!!

View 4 Replies View Related

Queries :: Using Part Of Date As Query Criteria From Combo Box?

Apr 4, 2013

I have a query with a date field that is formatted mm/dd/yyyy. I have a combo box that is formatted as mm/yyyy. I need the choice from the combo box to be the criteria for the date field in the query. the combo box has to contain the month and year only (which it does now) and the query must return mm/dd/yyyy. I have tried a few statements and the closest I got was a between statement that added 30 days to the combo box selection but that's not really accurate.

View 2 Replies View Related

Modules & VBA :: Save User Entry As Part Of Hyperlink Then Display In Subform

Nov 21, 2014

I have a form with multiple textboxes and comboboxes that allow for user entry, and a subform displaying a table, where the entries from the form are saved and can be retrieved. It's basically a way of creating new task entries and editing existing ones from a single interface.

One of the fields is an "issue number" of sorts, which is a 5-digit code that identifies the task. We have a website where details of each task are stored, and the URL format is akin to this: [URL] ....

The functionality that I'm hoping for is that when the user saves the record, it will be saved as the full link address, by concatenating the static first portion of the address and the code entered by the user. However, I need the table to still only display the code, not the whole link address, and will follow the full address when clicked in the subform table.

View 2 Replies View Related

Modules & VBA :: Save Access Report As PDF And Save To Folder

Jan 10, 2014

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?

View 4 Replies View Related

General :: Make File Name Part Of A Field Value

Jun 13, 2013

I'm trying to split up the filename into four separate fields. Here's an example of the filename:

123112 427900 55261 1156833.jpg

A 12312
B 427900
C 55261
D 1156833

The values A, B and C are always the same number of characters. The last value, D, changes in size. It can be anywhere from four characters to twenty. But it always starts at position "20" as with "1" in the case of the 1156833. The extension, jpg, is of no value.I might also add my programming ability is close to nonexistent.

View 2 Replies View Related

Wrong Field Value Being Retrieved

Dec 31, 2006

Hello All,

I’m having a problem getting the correct value from a form. I have a table name CITY.

Table: CITY

Field(s): [City_ID] [City Name]
1Boca Raton
2West Palm Beach
3Sunrise
4Palm Bay


My form uses the city table as a drop down look-up field. In the form it show’s up correctly by showing the City Name only.

The problem is that I have a command button that looks up the city in the form as part of an address lookup for Mapquest, but the value it retrieves is the numeric City_ID and not the City Name. How can I fix it to see the correct column?

View 3 Replies View Related

Limiting Records Retrieved To 10... With A Catch.

Jul 12, 2007

Hello all,

I am a buyer and I'm attempting to create a query in Access 2003 that will list all of my vendors (20 in total) and their top 10 selling sku's. Here are the fields I am using:

Buyer_Code
Supplier_Number
name
Sku_Global
OEM_Number
Part_Description_English
Status
C_Last12_SLS_QTY

I have created one Query including all of the above fields as well as the following field, "XP1: GetTen([Supplier_Number])"
In this query I have set "Supplier_Number" to sort ascending and "C_Last12_SLS_QTY" to sort descending.

I then created a module, written as follows:

Option Compare Database
Option Explicit
Public wSUPPLIER_NUMBER As String
Public wNum As Integer

Function GetTen(SUPPLIER_NUMBER) As Long
If wSUPPLIER_NUMBER = SUPPLIER_NUMBER Then
wNum = wNum + 1
Else
wNum = 1
End If
If wNum > 10 Then
GetTen = 0
Else
GetTen = wNum
End If
wSUPPLIER_NUMBER = SUPPLIER_NUMBER
End Function

I then created a second query with all of the above fields, and the criteria for the XP1 field as ">0"

As far as I can tell, this should bring me back a list with the first 10 rows for each of my Supplier numbers... unfortunately it is for some and for others it's bringing back more than 10 rows. The other problem is that it seems to be picking random rows to bring back, and not just the first 10 (which because in query1 I set the C_LAST12_SLS_QTY field to sort descending, should be my top 10 selling sku's).

Does anyone have any idea as to what I've done wrong? I'm pretty new with Access so I may be missing something pretty simple.

Any help would be greatly appreciated.

Antonio

View 3 Replies View Related

Adding Short Time In Query And Report

Apr 2, 2008

I am trying to add hours entered in a short time format. For example 08:15 or 02:55. I also would like it to give a total number of hours beyond 23:00. Here is a table with a Name Column and Hours Column

Name Hours
BETTER,HEATHER 8:00
BETTER,HEATHER 8:00
BETTER,HEATHER 5:41
BETTER,HEATHER 2:35
BETTER,HEATHER 1:15
WILLIAMS,R 2:30
WILLIAMS,R 0:45
WILLIAMS,R 11:20
WILLIAMS,R 8:25
WILLIAMS,R 8:15
WILLIAMS,R 10:20

How do I

A) write a query to add up the hours. I believe Heather would total 25:31 Hours.

B) Show this same total in a report? In my report I had a Name Footer which showed "=Sum([hours])". Will this work once the query is right or will I use the "=Sum([totaltime])"?

Also, is it possible for you to respond in a SQL statement so that I can copy? Thanks.

View 6 Replies View Related

Reports :: Adding Query To Existing Report?

Mar 15, 2014

Is it possible to add a query to an existing report? I use Access, not VBA.

View 1 Replies View Related

Reports :: Adding Query Result To A Report

Sep 16, 2013

I have a report (report1) which is based on a single query (query1).

There is a second query (query2) which returns just a single value (say 100) and I want the result of the query2 to appear at the bottom of the report1. The query2 is not related to the query1 so I cannot join them.

When I insert a text box in the report1 and choose the query2 from the control source Access gives the error, "The Microsoft Access database engine does not recognize '' as a valid field name or expression".

View 3 Replies View Related

Save Function For Adding New Records In A Form

Nov 24, 2006

Hi guys and girls,

I'm fairly new to Access and I'd appreciate some help. I've built a form with buttons to open new forms for that specific record (based on queries as all the data is held in a single table). This works fine until I try to add new records. At the moment the only way I can make this work is to add the new record, shut the original form before re-opening it and proceeding on to the other sections (via the buttons I mentioned).

If anyone could tell me how to get Access to save the record before it opens the other forms I'd really appreciate it.

Cheers,
Franny.

View 2 Replies View Related

Reports :: Can Create A Report A Little Like Cross Tab Query But Without Adding Anything Up?

Mar 6, 2015

I want to present some data in what seems to me like it would be a very natural and normal format, however have so far been unable to figure out how to do it.I record attendance data for a children's after school club in a table as follows (simplified):

AttendanceID - autonumber
AttendeeName - text
AttendanceDate - date
Attended - True / False

The data looks like this in the table. I would like to be able to easily see who attended on which days, so I would like to therefore see the data laid out like this:

The Crosstab query looks almost like it would do what I wanted, however it seems to insist on adding something up, rather than just showing me the value true or false.

View 7 Replies View Related

Adding A Date Parameter To A Query

Nov 8, 2007

Help...I am new to Access and am trying to get a query completed to run a query on contract end dates. My goal is to be able to run the query on a date such as 10/2007 and have it pull all contract end dates that would term for the month of October, 2007. I have been pulling my hair out trying to build expressions and sifting through my access books to no avail.

Any assistance is greatly appreciated!!!

-Michele

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







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