UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Pdf File Name, Access 2016    
 
   
mike60smart
post Jun 6 2020, 07:22 AM
Post#1


UtterAccess VIP
Posts: 14,034
Joined: 6-June 05
From: Dunbar,Scotland


Hi Everyone

I have declared a Report as:-

strReportname = "Quality Concerns"

I am using the following DoCmd to save the PDF File but it adds strReportName before the Date instead of "Quality Concerns"

Any help appreciated

CODE
110   DoCmd.OutputTo acOutputReport, strReportname, acFormatPDF, "C:\PDF Reports\ strReportname " & Format(Date, "mmddyyyy") & ".pdf", False

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
GroverParkGeorge
post Jun 6 2020, 07:26 AM
Post#2


UA Admin
Posts: 37,513
Joined: 20-June 02
From: Newcastle, WA


You are actually sending the file name that way. You'll have to use concatenation IN VBA to insert the value of the variable into the output, not the name of the variable.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
mike60smart
post Jun 6 2020, 07:49 AM
Post#3


UtterAccess VIP
Posts: 14,034
Joined: 6-June 05
From: Dunbar,Scotland


Hi George

I tried Concatenation but could not get the syntax right.

How would I do this?


--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
mike60smart
post Jun 6 2020, 07:53 AM
Post#4


UtterAccess VIP
Posts: 14,034
Joined: 6-June 05
From: Dunbar,Scotland


Hi George

This works

CODE
DoCmd.OutputTo acOutputReport, strReportname, acFormatPDF, "C:\PDF Reports\ QualityConcern" & "-" & Format(Date, "mmddyyyy") & ".pdf", False

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
GroverParkGeorge
post Jun 6 2020, 07:55 AM
Post#5


UA Admin
Posts: 37,513
Joined: 20-June 02
From: Newcastle, WA


That works because you are hard-coding the report name into the output string.

If you want to make it accept different report names, you can do that by concatenating the variable with the hard-coded elements.


--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
tina t
post Jun 6 2020, 09:20 AM
Post#6



Posts: 6,692
Joined: 11-November 10
From: SoCal, USA


hi Mike, try

CODE
110   DoCmd.OutputTo acOutputReport, strReportname, acFormatPDF, "C:\PDF Reports\" & strReportname  & "-" & Format(Date, "mmddyyyy") & ".pdf", False


hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 
mike60smart
post Jun 6 2020, 10:02 AM
Post#7


UtterAccess VIP
Posts: 14,034
Joined: 6-June 05
From: Dunbar,Scotland


Hi Tina

That works just great as well

Many thanks George & Tina
cheers.gif

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    14th July 2020 - 05:32 AM