# [SOLVED] Snapshot Viewer Problem



## rivergum_23 (Jul 27, 2011)

Hi Guys,
Can anybody help me with this annoying problem I cannot fix??
I’ve downloaded SnapView.mdb and it worked perfectly. However, in an effort to be able to transfer it to my own access project I decided try and transfer it across to a new separate project which I have attached, basically tried to reverse engineer the project to ensure I know the in and outs of the project. 
I’m getting a couple of errors which I cannot work out what I’m missing?? 
Any and all help very much appreciated.
Attached is my project Database1.zip
Attached is original project SnapView.zip downloaded 
Attached is Microsoft’s Snap Viewer that’s no longer included with Access 2007 and upwards;
http://support.microsoft.com/kb/928357
Thanks,
River


----------



## AlbertMC2 (Jul 15, 2010)

*Re: Snapshot Viewer Problem*

Hi

Why don't you just convert the snapview.mdb to Access 2007? That seems to work fine on my PC. What errors are you getting?


----------



## rivergum_23 (Jul 27, 2011)

*Re: Snapshot Viewer Problem*

Hi Albert,
Thanks for your comments. I ended up working out my problem with the viewer, basic mistake in the end.

Whilst I have your attention I have attached a project that I'm trying to change the text color and line weight based on the result of the membership result from the query report. I cannot seem to get it to work?? Can you help me out here with this one??

I'm using the format event on the Detail part of the report.

Cheers,
River


----------



## AlbertMC2 (Jul 15, 2010)

*Re: Snapshot Viewer Problem*

Hi

It seems you already have it right. But perhaps you want the whole record's font/weight changed? Then try:


```
If Me.Member = "N" Then
   Me.Member.ForeColor = vbRed
   Me.Member.FontWeight = 700
   Me.ID.ForeColor = vbRed
   Me.ID.FontWeight = 700
   Me.[First Name].ForeColor = vbRed
   Me.[First Name].FontWeight = 700
   Me.Surname.ForeColor = vbRed
   Me.Surname.FontWeight = 700
Else
   Me.Member.ForeColor = vbBlack
   Me.Member.FontWeight = 400
   Me.ID.ForeColor = vbBlack
   Me.ID.FontWeight = 400
   Me.[First Name].ForeColor = vbBlack
   Me.[First Name].FontWeight = 400
   Me.Surname.ForeColor = vbBlack
   Me.Surname.FontWeight = 400
End If
```


----------



## rivergum_23 (Jul 27, 2011)

*Re: Snapshot Viewer Problem*

Hi Albert,
Another simple error on my behalf.... I was expecting the change in color and line weight to show in Report View, however it’s not until print preview it will occur.

I have one final question; Do you know how to show the navigation pane in the snapshot viewer?? It’s there in design view of the form, however in runtime it’s not displayed??

Thanks a lot again Albert!

Cheers,
River


----------



## AlbertMC2 (Jul 15, 2010)

*Re: Snapshot Viewer Problem*

Hi

Snapshot Viewer is just a viewer just like Acrobat reader is just a viewer.
All it does is enable you to view snapshot (.SNP) files which are Access reports.
Therefore you cannot navigate or change records etc.
Access 2010 has actually done away with the snapshot format since you can export a report as a pdf or xps document.


----------



## rivergum_23 (Jul 27, 2011)

*Re: Snapshot Viewer Problem*

Hi Albert,
The navigation pane is the one that allows you to navigate between pages and print. My snp report is 3 pages long and I only can view the first page and need a way to get to the other pages. 

This would be possible?? wouldn't it??

Thanks again,
River


----------



## AlbertMC2 (Jul 15, 2010)

*Re: Snapshot Viewer Problem*

Aaaah, THAT navigation pane! My Apologies.
Open your database. Press ALT+F11 to open the VB Editor.
On the right side double click on *"Form_Form2"* to bring up the code for your sub form.
Then under the Form Open Sub procedure (Private Sub Form_Open(Cancel As Integer))
Change:
*snp.ShowNavigationButtons = False*
to
*snp.ShowNavigationButtons = True*

Save and try again.


----------



## rivergum_23 (Jul 27, 2011)

*Re: Snapshot Viewer Problem*

Hi Albert,
 Yes, I should have picked that up myself... I was looking in Form1 VBA for the command.... Anyway all is good now thanks..

Is it possible to create my own "Next Record" or "Next Page" command button? We are using this project on a touch screen and I would like to add a larger command button (if possible) for ease of the touch screen rather than the smaller navigation pane buttons.

No problem if it's not possible or an easy addition of code, but I thought I'd ask the question.

Once again, thanks a lot for you help on this one.

Cheers,
Brett


----------



## AlbertMC2 (Jul 15, 2010)

*Re: Snapshot Viewer Problem*

Hi

This took me a while...but yes you can create your own buttons.

Create 5 new buttons on the main form (Form1) and name them:
btnFirstPage
btnLastPage
btnNextPage
btnPreviousPage
btnprint

Then you can try something like:

```
Option Compare Database
Option Explicit

Private Sub EnableButtons()
    cboReport.SetFocus
    '2+ pages
    If Me.Form2.Form.snp.PageCount > 1 Then
        btnprint.Enabled = True
        '1stpage
        If Me.Form2.Form.snp.CurrentPage = 1 Then
            btnFirstPage.Enabled = False
            btnLastPage.Enabled = True
            btnNextPage.Enabled = True
            btnPreviousPage.Enabled = False
        'lastpage
        ElseIf Me.Form2.Form.snp.CurrentPage = Me.Form2.Form.snp.PageCount Then
            btnFirstPage.Enabled = True
            btnLastPage.Enabled = False
            btnNextPage.Enabled = False
            btnPreviousPage.Enabled = True
        'middle pages
        Else
            btnFirstPage.Enabled = True
            btnLastPage.Enabled = True
            btnNextPage.Enabled = True
            btnPreviousPage.Enabled = True
        End If
    '1 page
    ElseIf Me.Form2.Form.snp.PageCount = 1 Then
        btnFirstPage.Enabled = False
        btnLastPage.Enabled = False
        btnNextPage.Enabled = False
        btnPreviousPage.Enabled = False
        btnprint.Enabled = True
    Else
        btnFirstPage.Enabled = False
        btnLastPage.Enabled = False
        btnNextPage.Enabled = False
        btnPreviousPage.Enabled = False
        btnprint.Enabled = False
    End If
      
End Sub

Private Sub btnFirstPage_Click()
    Me.Form2.Form.snp.FirstPage
    Call EnableButtons
End Sub

Private Sub btnLastPage_Click()
    Me.Form2.Form.snp.LastPage
    Call EnableButtons
End Sub

Private Sub cboReport_Click()
    Echo 0
    DoCmd.OutputTo acOutputReport, Me.cboReport, acFormatSNP, CurrentProject.Path & "\" & Me.cboReport & ".snp"
    With Me.Form2.Form.snp
       .SnapshotPath = CurrentProject.Path & "\" & Me.cboReport & ".snp"
       .Zoom = snapZoomToFit
    End With
    Echo 1
    Call EnableButtons
End Sub

Private Sub btnNextPage_Click()
    Me.Form2.Form.snp.NextPage
    Call EnableButtons
End Sub

Private Sub btnPreviousPage_Click()
    Me.Form2.Form.snp.PreviousPage
    Call EnableButtons
End Sub

Private Sub btnPrint_Click()
    On Error Resume Next
    Me.Form2.Form.snp.PrintSnapshot True
End Sub

Private Sub Form_Open(Cancel As Integer)
    btnFirstPage.Enabled = False
    btnLastPage.Enabled = False
    btnNextPage.Enabled = False
    btnPreviousPage.Enabled = False
    btnprint.Enabled = False
End Sub

Private Sub Form_Resize()
   With Me.Form2
      .Height = Me.InsideHeight - .Top - .Left
      .Width = Me.InsideWidth - .Left * 2
   End With
End Sub
```
I have created a sub procedure *EnableButtons* which is run every time a button is clicked (Call EnableButtons). This procedure makes sure that the appropriate buttons are disabled when applicable. (eg if you are on the last page of the report then the "Last Page" and "Next Page" buttons are disabled due to the fact you cannot go further.)
Also I disabled the buttons as soon as you open Form1. They are then enabled as soon as you choose a form to display.

See my attached example. (I have converted it to Access 2007)


----------



## rivergum_23 (Jul 27, 2011)

*Re: Snapshot Viewer Problem*

Wow,
I certainly didn't expect you to go to this length; however I am very appreciative of your help and it works perfectly!!

Thanks for all your help.

Best Regards,


----------



## AlbertMC2 (Jul 15, 2010)

*Re: Snapshot Viewer Problem*

Hi

Even though I am helping you, I have never used the snapview activeX control so in effect I was learning as well. Therefore the more I play around with the different methods the more I learn.


----------



## Babbzzz (Jul 14, 2011)

*Re: Snapshot Viewer Problem*

Mark this thread as solved.


----------

