Display report preview inside form. Possible? Ideas?

  • Thread starter Thread starter Lee Schipper
  • Start date Start date
L

Lee Schipper

I have a form with a tab control, and I want the first page of the tab
control to display a read-only summary of the stuff buried inside all the
other tabs. Because the information is dynamic, formatting this summary
just using form controls would get pretty crazy, but formatting the summary
using a report would be a piece of cake.

Any way to display a report preview on a form? Or any other clever ideas
for laying out dynamic information on a form?

In lieu of a clever idea I am looking at creating a couple hundred hidden
controls on the form, then arranging them and populating them from code.
Alternately, is there a way to programmatically add a control to a form
without having to switch the form into design mode?

I don't have high hopes, but I am often amazed at the crazy solutions I find
posted here.

Thanks,
Lee
 
OK Lee, here is a crazy solution:

Output your report as a snapshot file, and then use the snapshot viewer
control on your form to view the snapshot file.

You could use code in the form load event to do this:

Private Sub Form_Load()

Dim strFile As String
Dim snpViewer As SnapshotViewer

strFile = Application.CurrentProject.Path & "\report.snp"
Set snpViewer = Me.snp.Object

DoCmd.OutputTo acOutputReport, "NameOfReport", acFormatSNP, strFile,
False
snpViewer.SnapshotPath = strFile

End Sub

This effectively gives you a preview view of the report on the form, which
is what you asked for, even though it is a rather convoluted way of going
about it!
 
Back
Top