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
> Error 3021 On Pdf Export, Access 2016    
 
   
JAchord
post Feb 19 2020, 12:46 PM
Post#1



Posts: 202
Joined: 11-July 14



I am getting a runtime error 3021 object not found when I try to export a report to pdf. Unfortunatly I have not been able to find the cause or even where to look in this application of the error. The same report will not print the subreport if there are over a certain number of records either but that is a different issue. Thanks for the help in advance.

CODE
DoCmd.OutputTo acOutputReport, Me.custName.Value & " Upgrades Report", "PDFFormat(*.pdf)", , , , , acExportQualityPrint
Go to the top of the page
 
theDBguy
post Feb 19 2020, 12:50 PM
Post#2


UA Moderator
Posts: 77,729
Joined: 19-June 07
From: SunnySandyEggo


Hi. Can you export other reports using the same code?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
msbad1959
post Feb 19 2020, 12:56 PM
Post#3



Posts: 40
Joined: 5-June 18



Try
CODE
Docmd.OutputTo acOutputReport,"report name in quotes or a variable", acFormatPDF,"h:\outputfilename.pdf",,,,acExportQualityPrint
Go to the top of the page
 
JAchord
post Feb 19 2020, 03:14 PM
Post#4



Posts: 202
Joined: 11-July 14



This is the only report i have right now. Everything else I just export a query to excel. Unfortunately I just received a new laptop and now have access 365 instead of 2016. My code will not run now or compile throws an error on all most every module for something not found. Fortunately the compiled executable works fine. So the only person affected is me on the working copy. pullhair.gif crazy.gif
Go to the top of the page
 
MadPiet
post Feb 19 2020, 03:17 PM
Post#5



Posts: 3,578
Joined: 27-February 09



What errors do you get? You may be missing some libraries.
Go to the top of the page
 
JAchord
post Feb 19 2020, 03:43 PM
Post#6



Posts: 202
Joined: 11-July 14



Thats what i am looking at. It just can't seem to find objects. For instance I had some of the copied error checking as msgbx Error$. no good. Some of the form names lost their "" so now the forms can't be found on a close command. Honestly I can't even get past my splash form.
Go to the top of the page
 
JAchord
post Feb 19 2020, 05:45 PM
Post#7



Posts: 202
Joined: 11-July 14



yes it was a missing reference. Now back to the previously scheduled error.

So I tried the code below and now it is giving me a 2059 error can not find the object 'I1'. Not sure what that means. The report points directly to a table then has a subreport based on a query linked to a value on the master report. The subreport also has its own subreport. I am guessing that something is being lost in the subreports. Guess I need to track down some errant query value.

CODE
DoCmd.OutputTo acOutputReport, Me.custName.Value & " Upgrades Report", acFormatPDF, "C:\users\%USERNAME%\documents\" & Me.custName.Value & " Upgrades Report.pdf", , , , acExportQualityPrint


SQL for first subreport linked to the master report by the currentcustomerIDKey

CODE
SELECT SerialStatusTBL.Status, SerialNumbertbl.CustomerDesignation, SerialNumbertbl.serialno, SerialNumbertbl.CurrentCustomerIDKEY, SerialNumbertbl.SerialIDKey, TypeMasterTBL.MachineTypeDescription, ModelTBL.model
FROM (TypeMasterTBL RIGHT JOIN (SerialNumbertbl LEFT JOIN ModelTBL ON SerialNumbertbl.ModelIDKey = ModelTBL.ModelIDKey) ON TypeMasterTBL.TypeMasterIDKey = SerialNumbertbl.MastertypeIDKEY) LEFT JOIN SerialStatusTBL ON SerialNumbertbl.MachinestatusIDKey = SerialStatusTBL.MachineStatusIDKEY
WHERE (((SerialNumbertbl.MachinestatusIDKey) Not Like 3 And (SerialNumbertbl.MachinestatusIDKey) Not Like 5))
ORDER BY SerialStatusTBL.Status, SerialNumbertbl.CustomerDesignation, SerialNumbertbl.serialno;


Here is the second subreport SQL Linked to the first through the serialidkey

CODE
SELECT UpgradesTBL.SAPTopLevel, UpgradesTBL.Description, UpgradesTBL.LastQuoteprice, UpgradesTBL.LastQuoteDate, UpgradesTBL.MasterTypeIDKEY, UpgradesTBL.ModelIDkey, UpgradesTBL.UpgradeMOCIndex, SerialNumbertbl.SerialIDKey, upgradeclasstbl.UpgradeClass
FROM (((((SerialNumbertbl LEFT JOIN MOCtbl ON SerialNumbertbl.MOCIndex = MOCtbl.MOCIndex) LEFT JOIN MOCTypeTBL ON MOCtbl.MOCTypeIDKey = MOCTypeTBL.MOCTypeIDKey) LEFT JOIN UpgradesTBL ON SerialNumbertbl.ProductClass = UpgradesTBL.ProductClassIDKey) LEFT JOIN ModelTBL ON SerialNumbertbl.ModelIDKey = ModelTBL.ModelIDKey) LEFT JOIN TypeMasterTBL ON SerialNumbertbl.MastertypeIDKEY = TypeMasterTBL.TypeMasterIDKey) LEFT JOIN upgradeclasstbl ON UpgradesTBL.UpgradeclassIDKey = upgradeclasstbl.UpgradeclassIDKEY
WHERE (((UpgradesTBL.MasterTypeIDKEY) Like [SerialNumbertbl]![MastertypeIDKEY] Or (UpgradesTBL.MasterTypeIDKEY)=20) AND ((UpgradesTBL.ModelIDkey) Like [SerialNumbertbl]![ModelIDKey] Or (UpgradesTBL.ModelIDkey)=499) AND ((UpgradesTBL.UpgradeMOCIndex) Like [MOCTypeTBL]![MOCTypeIDKey] Or (UpgradesTBL.UpgradeMOCIndex)=15))
ORDER BY UpgradesTBL.Description;


I think I will have to make another table to link the upgrades to the machines.
This post has been edited by JAchord: Feb 19 2020, 05:56 PM
Go to the top of the page
 
Bullschmidt
post Mar 14 2020, 10:00 PM
Post#8



Posts: 31
Joined: 8-May 19
From: USA


QUOTE
So I tried the code below and now it is giving me a 2059 error can not find the object 'I1'. Not sure what that means.


Well you might want to first try and figure out why your code is looking to do something with an object called 'I1'...

--------------------
J. Paul Schmidt - Freelance Web and Database Developer
Sample Database on the Web
Sample Access Database

Go to the top of the page
 
JAchord
post Mar 17 2020, 08:47 AM
Post#9



Posts: 202
Joined: 11-July 14



That is why i am stumped there is nothing in the code referred to as I1 in the entire project. My first thought was maybe a piece of junk code that was left behind so i looked for it and it is not there. Not sure if this is something embedded in access or a library that i have no control over.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    7th April 2020 - 10:39 AM