?
Solved

Output To Snapshot

Posted on 2007-08-06
14
Medium Priority
?
804 Views
Last Modified: 2013-11-05
For some reason this code is giving me the "you need to install a printer" error. I have five installed. it breaks on docmd.output. here is the code:

Private Sub cmdLoop_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
Dim strOldSQL As String
Dim strQry As String
Dim strRpt As String

Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT * FROM qrySys_CreatePDF") 'Hazard/Engine combinations

Do While Not rs.EOF

    strQry = "qrySys_CreatePDFSource"
   
    strSQL = "SELECT h.[Haz_Trk_No] & [Engine_Mod] AS HTRModel, " & _
    " h.[Haz_Trk_No] & [Engine_Mod] AS HTRModelTwo," & _
    " h.Haz_Trk_No , h.Date_Open, h.SAR, h.Title, h.Assy_Desc, h.Part_Desc, h.Safety_Own," & _
    " h.RootCause, h.WorklistDate, h.Hazdescpt, h.BriefHazDesc, ms.Engine_Mod, ms.Status," & _
    " ms.Stat_Date, ms.Statusinfo, ms.TaskOwnr, ms.PlanContPlan, ms.RevContPlan," & _
    " ms.ActlContPlan, ms.RiskAssess, ms.[ECP/TCTO Number]," & _
    " ms.[TCTO/PPC Number], ms.QTR_status_AI_link, ms.pop, ms.Q_comp, ms.P_comp_date, ms.P_actions," & _
    " ms.EPD, ms.ICA, ms.FCA, ms.FundingSource, ms.ActualNRIFSD, ms.ActualERLOA, ms.EventsSinceICA," & _
    " al.[Statement No], al.Engineer, ms.RiskAssess" & _
    " FROM (tbHAZARD AS h INNER JOIN tbMainSTATUS AS ms ON h.Haz_Trk_No = ms.Haz_Trk_No) " & _
    " LEFT JOIN Assessment_Log AS al ON ms.RiskAssess = al.[Statement No]" & _
    " WHERE  (h.[Haz_Trk_No] & [Engine_Mod]) = " & "'" & rs!HTRModel & "'" & _
    " ORDER BY h.[Haz_Trk_No] & [Engine_Mod] DESC , h.[Haz_Trk_No] & [Engine_Mod] DESC ," & _
    " ms.Stat_Date DESC;"


    strOldSQL = ChangeSQL(strQry, strSQL)
           
    DoCmd.OutputTo acOutputReport, "rptHTRDetail_PDF", "Snapshot Format", "C:\Test.snp"
    ResetDefaultPrinter
    rs.MoveNext
   
Loop

rs.Close
Set rs = Nothing
Set db = Nothing


End Sub

0
Comment
Question by:adraughn
13 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 19639315
the formats are

AcFormat can be one of these AcFormat constants.
acFormatASP
acFormatDAP
acFormatHTML
acFormatIIS
acFormatRTF
acFormatSNP
acFormatTXT
acFormatXLS

try using  

       acFormatSNP   instead of "Snapshot Format",
0
 
LVL 13

Author Comment

by:adraughn
ID: 19639522
that didn't work. same error.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 19639630
is "rptHTRDetail_PDF" just a report ?
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
LVL 13

Author Comment

by:adraughn
ID: 19639650
yes, it is the name of my access report
0
 
LVL 4

Expert Comment

by:ki_ki
ID: 19639661
can you run the report from the database window, not from code?
0
 
LVL 13

Author Comment

by:adraughn
ID: 19639719
no, anytime i try to run a report or open something in design view it tells me to install a printer.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 19639731
do you have snapshot viewer?
0
 
LVL 13

Author Comment

by:adraughn
ID: 19639839
yes - i checked that, i do.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 19639946
can you try this.
use the Northwind.mdb
create a command line like what you have using any report.

see if you get the same error...
0
 
LVL 13

Author Comment

by:adraughn
ID: 19639973
thanks, but i fixed it. my print settings must have gone crazy when i was working with adobe. i rebooted and all is well. thanks for your help.

a
0
 
LVL 6

Expert Comment

by:mmconsultant
ID: 19640001
Is there any code in the report itself which checks or manipulates the printers?
0
 
LVL 75
ID: 19640669
""you need to install a printer"

Oddly enough, someone in our group had this issue recently ... wherein the printer most likely got hosed when they were messing with acrobat and happened to reboot  ... at least that's the story I got ... which fixed the problem !!  No doubt a long shot ... but hey ...

mx
0
 
LVL 1

Accepted Solution

by:
Vee_Mod earned 0 total points
ID: 19677722
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question