How to display an unbound form field on a report?

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I have a form that lets you select a customer based on they're customer ID,
which then brings up phone, fax, contact, etc. I also have an unbound text
box on the form where you can type in a message. I then have a report based
on this form formatted as a fax cover sheet that works great, except that I
can't get it to display any information from the unbound text box.

So my question is, how do I display information from the unbound control on
the form on the report? And also to have it save a copy of the report after
printing? Either as another access report, or in another format ie MS Word?
I'm familiar with Access, but new to VB, so if there is any coding involved,
I would need an example. I'm using Office 2003.
Thanks for any help.

Jim
 
To pick up the contents of a text box on a form and display it on your
report, set the Control Source of the text box on the report to:
=[Forms]![NameOfYourFormHere]![NameOfYourTextboxHere]

There are several ways to save a copy of the print out.
If you preview the report, you can use the Publish With Word icon on the
toolbar to export the report in Rich Text, though that loses lines and
graphics. Exporting to PDF is better. If you just want the data (not the
layout), you could use TransferText on the query that feeds the report.

It is possible to export a snapshot. The following is from the A2003 help
file:
<quote>
About report snapshots and Snapshot Viewer
A report snapshot is a file (.snp extension) that contains a high-fidelity
copy of each page of a Microsoft Access report and that preserves the
two-dimensional layout, graphics, and other embedded objects of the report.

Snapshot Viewer is a program that you can use to view, print, and mail a
snapshot, such as a report snapshot. Snapshot Viewer version 11.0 consists
of a stand-alone executable program, a Snapshot Viewer control
(snapview.ocx), a Help file, and other related files. By default, Snapshot
Viewer is automatically installed by Access the first time you create a
report snapshot. You can also install Snapshot Viewer from the Setup
program, or from a software download page located on the Microsoft Office
Developer's Web site.

You can use the Snapshot Viewer control to view a snapshot from Microsoft
Internet Explorer version 3.0 or later or from any application that supports
ActiveX controls, such as Access or Microsoft Visual Basic for Applications.

You use Access to create a report snapshot. However, you can view, print,
store, publish, distribute, and archive a report snapshot without having an
Access license by using a combination of Snapshot Viewer

</quote>
 
Jim,

Just refer directly in the Control Source of the textbox on the report,
to the textbox on the form, i.e.
=[Forms]![NameOfForm]![NameOfMessageTextbox]
Of course, for this to work, the form has to still be open at the time
that the report is printed.

The "native" format for saving the report is to export it to a Snapshot
file. You can use the OutputTo action in a macro, or the DoCmd.OutputTo
method in a VBA procedure, for this. Have a look in Help on this, and
post back if you need more specific help.
 
Back
Top