473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Changing the file name for a PDF report from Access

204 128KB
I have an Access 365 application in which the user can print various reports as PDF files. To achieve this I have a "Print" button on the report which calls a standard module which uses DoCmd.Printout to print the report to the default PDF printer. Access sets the name of the resultant PDF to the caption of the report. While the captions (and thus PDF filenames) are set at design time to a generic name, I want to differentiate individual instances of a report by dynamically adding to the caption, when the report is opened, an identifier held in a global variable.
Sometimes this works, sometimes it doesn't. When it does, the filename comes out as the new value given when the report is opened. When it doesn't, the filename remains set to the string given at design time.

I have read suggestions on various forums suggesting the questioner should either
(a) open the report in design view, change the caption, then switch to report or print view; or
(b) Use DoCmd.OutputTo instead of DoCmd.Printout. 'For various reasons I am reluctant to use these approaches. The question exercising my mind at present, however, is "Why does changing the caption in the On Open event procedure work in some instances but not in others?"

Examples:
(1) Report 26: Caption given at design time - "All Emmaus Events".
Nov 9 '22 #1
0 468

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: AJ | last post by:
Hi , I am trying to dynamically change file name of an html that is generated through a cgi script, I know that for it is easy to do this for other type of files such as pdf or csv which we...
2
by: Jamie A. Landers | last post by:
I have a macro that runs to export a report. It dumps a report on the server in RTF format. Here's the problem that I am having. I would like for the report to have a custom file name daily, like...
1
by: Doug | last post by:
I am sending out snapshot reports and I would like to change the name given to that particular snapshot report to include a date range instead of just the report name. Is there a way to add...
0
by: Tuan Nguyen | last post by:
Hi all, I am writing asp.net with access database. I want to store text (messages) in the access database. However, the text data type in access database only allows me to store up to 255...
2
by: | last post by:
I have code to download a file from a webserver to a local machine through the browser using code dim file as System.IO.FileInfo = new System.IO.FileInfo("c:\_6_test.txt") Response.Clear();...
1
by: MikeD | last post by:
Hi, I'm accessing a FoxPro database via ole db using Reporting Services Data Extensions and ths works fine on my local report server. However, when I deploy the report to the live report server...
3
by: Bonzol | last post by:
Vb.net 2003, Web application Hey all! Just a quick question. I have a site which allows users the ability to upload files by the HTML brows button control. My question is if a user submits...
1
by: joyfat | last post by:
I'm writting a program for upload file to Web server first I new a file folder name Report on my Web Server and then new many sub file folder in the Report file folder WebServer -- Report ...
1
by: CK | last post by:
Hi All, How do I parse a file path in Access for return the file name? Example c:\somefolder\somefolder\somefolder\somefolder\somefolder\somefolder\somefolder\someFile.xls I want to query a table...
0
by: nilesh tayde | last post by:
how can i pass parameter to print access report by giving parameter as Report File Name,Query,PrinterName,Number of copies to be print my code is Function fPrintRemoteReport(strMDB As...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.