Printing unbound text boxes with a chart

  • Thread starter Kurt cairns2000atOzemail.com.au
  • Start date
K

Kurt cairns2000atOzemail.com.au

I am using an event procedure for 'On Format' in the
report header which extracts information from an open
form on which I choose from a combo box to go into the
unbound text box. It works fine and the print preview is
just as I want BUT when I try to actually print, nothing
happens other that the message "Now Printing". If I
diable the event procedure, the chart prints out OK.
 
A

Allen Browne

Hi Kurt.

What you are suggesting should be fine if the form is still open.

When you print the report, it runs all the code again, including
ReportHeader_Format. The code should still run, so not sure what's actually
happening in your case. Perhaps you could insert a break point to find out.

If you wish to make the report independent of the form after it opens, use
Report_Open to retrieve the values from the form. While you cannot assign
values to the text boxes in Report_Open, you can assign their ControlSource,
e.g.:

With Forms!MyForm
If Not IsNull(!SomeControl) Then
Me.SomeTextbox.ControlSource = "=""" & !SomeControl & """"
End If
End With

Even easier, you could use a label and write to its Caption if you do not
need CanGrow.

Alternatively, you can store the value into module-level variables, and
assign them in the appropriate event.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"Kurt cairns2000atOzemail.com.au" <[email protected]>
wrote in message
news:[email protected]...
 
K

Kurt

Many thanks Allen

I am using the method to write to a label.
I still do not uncerstand why writing to an unbound
textbox doesn't work. It print previewed exactly as I
wanted but did not print.
Via labels it print previews and prints to laser printer.
Many thanks
Kurt
 
Top