Unbound Report - Print Preview OK but Direct to Print Fails

sgrace

Registered User.
Local time
Today, 10:31
Joined
Dec 13, 2011
Messages
22
Hello All,

I have an unbound form with an associated report. When the user hits the 'print' button on the form/screen, the report is launched in the background. In the On Load event of the report I populate the report fields from the forms field as so:

Code:
Me.txtAddrMainLine2 = "NAME " & UCase([Forms]![frm_OrderRx].[txtPatientName])
This works like a charm as long as I call the report in Print Preview mode (i.e. with acViewPreview). But if I send the report directly to the printer, none of the fields print. : (

I've read about using other report events to populate the fields (e.g., On Format and On Print) and also something about using TempVars to pass the data. But I haven't read anything that's clear and definitive about the full answer. Hoping someone here can oblige.
 
When I have the unbound field assignments in the On Load event of the report, the report prints but is blank.

I moved the header data assignments to the 'On Format' event of the header section of the report. The form prints with the correct header information and the rest is blank.

Then I moved the rest of the data assignments for the body of the report to the On Format event of the detail section of the report. Access tells me the report is sent to the printer but nothing comes out. Nothing. Not even a blank form. And nothing is queued. It's like the report just disappears.

Very frustrating. :(

Any help very much appreciated.
 
Fyi, I wasn't able to figure out what was going wrong so I went about the field assignments differently and moved some other code from the report to the form. Was able to successfully use the On Format event of header and detail sections of the report.
 

Users who are viewing this thread

Back
Top Bottom