Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    May 2001
    Location
    Omaha, NE USA, Nebraska, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing a Snapshot report from VBA (Access97/SR1)

    Can someone help me with the necessary code to print a snapshot report from code within Access.

    I have several reports that are generated by an offsite facility that I want to include in a set of reports that I am distributing. I am looking for a way to have a piece of code print the report without any user intervention.

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    Basically, your code needs to look like this:

    DoCmd.OutputTo acOutputReport, strReportName, "Snapshot Format", strFilePath
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    2 Star Lounger
    Join Date
    May 2001
    Location
    Omaha, NE USA, Nebraska, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    I can't seem to get this to work. Does Access97 support the OutputTo with a format of Snapshot? Every help file I looked at doesn't list it as an available intrinsic constant. However, I see it (acFormatSNP) listed with references to Access2000.

    Any workarounds for Access97?

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    You might need the Access97 SR-2 to make this work. That's what I have, and it recognizes that "Snapshot Format" in the command. You can get SR-2 for free from Microsoft website.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    2 Star Lounger
    Join Date
    May 2001
    Location
    Omaha, NE USA, Nebraska, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    That is very good news. Why do you say?

    I recently received an upgraded PC here at work (sort of, at least it's better than what I had) but I noticed that all of the Office 97 components are updated to SR2 except for Access. I have submitted work requests to have Access upgraded to SR2 as well. Hopefully it only takes one full moon.

    I will let you know how it works.

    Thanks for your timely repsonses.

  6. #6
    2 Star Lounger
    Join Date
    May 2001
    Location
    Omaha, NE USA, Nebraska, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    Can you please use some fake file and path names and show me exactly what you are using. I can't get it to work, I keep getting a message that says the file name is spelled incorrectly. Also the intrinsic constant of acFormatSNP does not show up on my home PC (Access97/SR2). Are you actually putting "Snapshot Format" in the code or are you using acFormatSNP. <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    You actually have to use the string "Snapshort Format", just as I wrote it.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  8. #8
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    MarkJ and I had a similar conversation in this <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=acc&Number=32803&page=& view=&sb=&o=&vc=1#Post32803>thread</A> By using a macro and converting it, I came up with this syntax:
    <hr>DoCmd.OutputTo acReport, "rptMyReport", "SnapshotFormat(*.snp)", "c:mydocumentsmyreport.snp"<hr>
    Give it a try and let us know how it works. Hope it helps. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  9. #9
    2 Star Lounger
    Join Date
    May 2001
    Location
    Omaha, NE USA, Nebraska, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    Edited by Charlotte to eliminate horizontal scrolling

    Ok, I finally got it to work using the following code:

    DoCmd.OutputTo acOutputReport, "z0_ME Cover Henderson", "SnapshotFormat(*.snp)", "s:PRODUCTIONMisHenderson test.snp", False, ""


    Thanks to those who helped. BUT, <font color=red>I must have asked the wrong question in the first place.</font color=red> The above situations work great if I need to generate a snapshot from the existing database's data. In my situation, the data changes from day to day (sometimes hour to hour). An out-of-state sister facility produces their daily reports and places a copy in a network folder in the snapshot format. When I get ready to run my daily reports (hard-copied), I open my database and use a switchboard button to start code that prints off all the necessary reports in the correct order. What I am trying to do, is find way to use the same code that generates my daily (hard-copied) report to also include the snapshot reports from sister facility.

    Does this even sound doable?? At first I thought yes, because Access has the ability to open Excel, open a file, print a specific worksheet, then close Excel. So I naturally assumed <img src=/S/doh.gif border=0 alt=doh width=15 height=15> that this would also be possible with a Snapshot report.

    Here is a sample of the code I am currently using, the <font color=blue>blue</font color=blue> text is what I need to edit.

    <pre>Function Proc__PrintReports()
    DoCmd.OpenReport "Volume Received - Summary", _
    acNormal, "", ""
    DoCmd.OpenReport "Daily Summary All RCs (modified 041100)", _
    acNormal, "", ""
    DoCmd.OpenReport "MTD Production Summary (modified 041100)", _
    acNormal, "", ""
    DoCmd.OpenReport "YTD Production Summary (modified 041100)", _
    acNormal, "", ""
    DoCmd.OpenReport "CPWU Summary All RCs (modified 041100)", _
    acNormal, "", ""
    <font color=blue>DoCmd.OutputTo acOutputReport, "z0_ME Cover Henderson", _
    "SnapshotFormat (*.snp)", "s:PRODUCTIONMisHenderson test.snp", _
    False, ""</font color=blue>
    DoCmd.OpenReport "Daily Operator Embossing", _
    acNormal, "", ""
    DoCmd.OpenReport "Daily Operator Match Merge", _
    acNormal, "", ""
    DoCmd.OpenReport "Daily Operator Half Bowe", _
    acNormal, "", ""
    DoCmd.OpenReport "Daily Operator Laser Print", _
    acNormal, "", ""
    DoCmd.OpenReport "Daily Operator Tagging", _
    acNormal, "", ""
    DoCmd.OpenReport "Daily Operator Hold", _
    acNormal, "", ""
    DoCmd.OpenReport "Daily Operator Handstuffing", _
    acNormal, "", ""
    DoCmd.OpenReport "Daily Operator Inserting", _
    acNormal, "", ""
    End Function
    </pre>


    Any thoughts or ideas??

  10. #10
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a Snapshot report from VBA (Access97/SR1)

    Steve, looking at your original post, in retrospect your question was pretty clear. My mind on the other hand was a little fuzzy. Unfortunately, I don't have an answer for you. You may be able to call Snapview.exe with a command line to invoke print, but I'm afraid I don't know how. There is an ActiveX control available to load snapshot files and once loaded a PrintSnapshot Method is available but again this is a little beyond my abilities. Perhaps this will lead you in the right direction though. The other option of course is to have the data rather than the report transmitted to you. Then you could construct and print the report locally. Sorry, I couldn't be more help. Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •