Showing a value from a form in a report header

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form where I through three parameters, chosen by combos, show a list
of records. A code at the same time populates the label for the list showing
the parameters plus some text to make it understandable.
A print button closes the form and open a report with records from the form
list. Now I want to make an unbound text box in the report header, which
shows the content of the label in the form ( because it actually shows the
criteria for the record selection).
How do I do this? I have tried to set the control source for the text box to
=DLookUp, but it does not work.
Niels
 
If your <print> button closes the form, what does your report have to look
at?

Leave the form open and open the report, in which you can "point" back to
the form by using an unbound control/textbox with a Control Source something
like:
=Forms!YourOpenForm!YourFormControlName

Good luck

Jeff Boyce
<Office/Access MVP>
 
Thaks Jeff. Just thought that it looks more neat when the formcloses at the
same time.
By the way, the report gets its data from a query using the form parameters.
Niels
 
However, although the form "frmParam3Test" is open, I still get a #Error in
report. Why?
The control source for the report unbound text box is:
=Forms!frmParam3Test!lbllist
Niels
 
Niels

Your "control" is a label? ("lbllist")

How are you stuffing the text of your criteria into the label? Using the
control's .Caption property? If so, you'll need to use that same property
to get it back out.

Or, you could set the control to be a textbox control, and set its value to
the search/filter string.

Another approach, from a form, is to use a filter or WHERE clause in a
command button that opens the report. This means the report doesn't need to
look "back" to the form.

Regards

Jeff Boyce
<Office/Access MVP>
 
Back
Top