Populate report header field from query parameter

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

Guest

Hello,

I have a report that populates a field in the header from a report
parameter. This parameter field is a date which is used in the query to pick
up all records with a date prior to the entered parameter date. I am making
the controlsource property in the report field equal to the query parameter
name.

If there are records that meet the query criteria the report field properly
displays the parameter date entered by the user. The problem is when the
query doesn't return any records then the report field doesn't display the
value entered by the user as a parameter date but rather displays #Error.

Thanks
 
Thanks Duane. I will do that but I do have another question on this issue. Is
it possible to access the parameter value property of a query from within a
report which is bound to that query?
 
You won't need to. You can just access the control value.

However, if you want to access a parameter prompt value from a query, the
query must return at least one record.
 
I had the same problem. The parameter did not print because there was no
data. Then I hid a field that should say either "initial", "pending" or
"closed" depending what the user put in the parameter box. Then I referenced
to the box by creating a new text box, but it was still blank, because the
initial field that reads, for example, "initial", did not say that, because
there was no data. Did I miss Duane's answer? The website does not seem to
give answers. What to do?
 
Is there absolutely no workaround to display the parameter on the report if
there is no data? No programming?
 
Can you see the earlier postings in this thread that suggest getting all
criteria from controls on forms? You can always reference the form control
in your report.
 
Back
Top