Pop-Up Reports

andy_dyer

Registered User.
Local time
Today, 03:43
Joined
Jul 2, 2003
Messages
806
In the vain attempt to lock down access to the average user for my database, I have through these forums been offered some code which locks down my actual access window.

I have now changed all of the forms to "pop-up" so that I can see them without the need for my access window to be activated again.

My only problem is that the two reports I run don't seem to have this option to select pop-up for reports.

Does anyone have any suggestions as to how I can get these to appear on my screen outside of the access window?

Thanks

Andy
 
It's possible to have a report viewed on a form by using the Snapshot Viewer Control. So you could basically create a popup form that is used just to view the reports. I don't think it's possible to view the reports themselves outside the Access window.

IMO
 
Thanks IMO,

Being a newbie and not at all conversant in VBA, how can I use the snapshot viewer control to show my report in a form?

Thanks

Andy
 
Here's an example for you, it's in A2k let me know if you need 97

IMO
 

Attachments

Thank's 4 everything IMO,

That worked & looks amazing!

Do you guys have a sample database for every eventuality?

:D

Thanks again,

Andy
 
Glad you got it sorted

IMO
 
The easiest way would be to import the module into your DB, Copy the Snapshot Viewer by opening the example form in design mode and right clicking on it. Paste it into your new form. In the OnOpen event of the form type....

Code:
    sPrint "YourReportNameGoesHere"

In the module itself change the following code
Code:
    strSavePath = "C:\"
    Set ctlActiveXHolder = Forms![frmReportViewer].acxSna

strSavePath = "C:\" being the path to store the snapshots and [frmReportViewer] change to the name of your report. Also change this
Code:
    With ctlActiveXHolder
        .SnapshotPath = "C:\" & strReport & ".snp"

"C:\" being the same path as above


Hope this helps
Let me know how you get on

IMO
 
Last edited:
Question

IMO,
This looks great. I'm having a bit of trouble with my where clauses though. I want to have a similar ReportViewer form that is opened from a main form's 'Print Record' button. Do you know how I could pass a value from the main form as a criterion for filtering the report that will be outputted to the snapshot file and viewed in the ReportViewer form.

As an example, I have a main form called frmTranscriptDetails. On this form I have a unique field [TRNumber] and a cmd button called 'Print Record.' Upon clicking this cmd button, I want to open the ReportViewer and filter the report using the value of the [TRNumber] field from the form frmTranscriptDetails. Not sure how to pass the [TRNumber] value so far, and my attempt at a where clause isn't working either.

Your sample had:
Code:
sPrint "rptTest1", , "Name Like '*s*'"
which works fine to filter the names with an s

I added a test text box to type a specific criteria and tried this clause which did not work (along with many other versions).
Code:
sPrint "rptTest1", , "[Name] = [txtTest]"
I wonder if you can tell me what I have done wrong.

Any help is appreciated.
 
Nacho,

sPrint "rptTest1", , "[Name] = '" & [txtTest] & "'"

But I think Name is a reserved word.

Wayne
 
Roger that.

Thanks again, Wayne. The [Name] deal was just from a sample db, not my own. Take it slow.

-Lou
 
Thanks, Wayne.

What would this be like if the field [Name] was a number field?

I thought that I would not need delimiters for a number field, but I can't get this thing to work.

using my own fields I have:
Code:
sPrint "rptTranscriptDetails",,"[TRNumber]=" & [txtTest]
I also tried this:
Code:
sPrint "rptTranscriptDetails",,"[TRNumber]=" & FormatNumber(Me![txtTest],0,,, vbFalse)
but that didn't work either.

Don't see what's up here.
 

Users who are viewing this thread

Back
Top Bottom