Showing a value from a form in a report header

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
 
J

Jeff Boyce

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>
 
G

Guest

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
 
G

Guest

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
 
J

Jeff Boyce

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top