Report parameters print as #Name?

  • Thread starter Thread starter David Gottholm
  • Start date Start date
D

David Gottholm

I have a set of reports that I pass dynamic parameters to
based on user input to a report dialog form. I print
these parameters on the header of the report so the user
will know what they entered to filter the report.

On the report, I reference them via the Control Source -
e.g. Forms!DialogForm![DialogField] Everything works
well. When I preview the report, the passed parameters
show up on the report. However, when I then print the
same report, the parameters no longer show up. I just get
the #Name? where I had the valid report parameter values.
I know this is because it cannot reference them, but I am
unsure as to why since I could see them in the preview of
the report.

Any ideas or solutions so that I can have these values
printed on the report?

Thanks,

Dave
 
Yes, I do have code that closes the dialog. The issue is
not in generating the report with the parameters. I do
that via the DoCmd.OpenReport and pass the dynamically
created where clause which works fine. It's just in
printing the parameters on the header page.

I'm not sure if your suggestion of using a calculated
column is for the report filter or printing the parameters
on the main page? How exactly would you use the
calculated column to get the parameters printed on the
header page?

Thanks,

Dave

-----Original Message-----
Do you have any code that closes the dialog form? You can create a
calculated column in your query:
DiaField:Forms!DialogForm![DialogField]

--
Duane Hookom
MS Access MVP


David Gottholm said:
I have a set of reports that I pass dynamic parameters to
based on user input to a report dialog form. I print
these parameters on the header of the report so the user
will know what they entered to filter the report.

On the report, I reference them via the Control Source -
e.g. Forms!DialogForm![DialogField] Everything works
well. When I preview the report, the passed parameters
show up on the report. However, when I then print the
same report, the parameters no longer show up. I just get
the #Name? where I had the valid report parameter values.
I know this is because it cannot reference them, but I am
unsure as to why since I could see them in the preview of
the report.

Any ideas or solutions so that I can have these values
printed on the report?

Thanks,

Dave


.
 
I close the report dialog form right after i do the
DoCmd.OpenReport.

I guess I'm not sure how I get the parameter value from
the dialog form to the calculated column in the query? Do
I just specify the reference to the dialog form field in
the query? And my next question would then be how do I
reference that calculated column on the header of the
report. Would I set the control value of the field to the
calculated query?

Thanks,

Dave


-----Original Message-----
When do you close the form?
The calculated column in the query allows you to reference the new column in
your report rather than the form control. You would be able to use
[DiaField] rather than Forms!...

--
Duane Hookom
Microsoft Access MVP


Dave said:
Yes, I do have code that closes the dialog. The issue is
not in generating the report with the parameters. I do
that via the DoCmd.OpenReport and pass the dynamically
created where clause which works fine. It's just in
printing the parameters on the header page.

I'm not sure if your suggestion of using a calculated
column is for the report filter or printing the parameters
on the main page? How exactly would you use the
calculated column to get the parameters printed on the
header page?

Thanks,

Dave

-----Original Message-----
Do you have any code that closes the dialog form? You
can
create a
calculated column in your query:
DiaField:Forms!DialogForm![DialogField]

--
Duane Hookom
MS Access MVP


I have a set of reports that I pass dynamic
parameters
to
based on user input to a report dialog form. I print
these parameters on the header of the report so the user
will know what they entered to filter the report.

On the report, I reference them via the Control Source -
e.g. Forms!DialogForm![DialogField] Everything works
well. When I preview the report, the passed parameters
show up on the report. However, when I then print the
same report, the parameters no longer show up. I
just
get
the #Name? where I had the valid report parameter values.
I know this is because it cannot reference them, but
I
am
unsure as to why since I could see them in the
preview
of
the report.

Any ideas or solutions so that I can have these values
printed on the report?

Thanks,

Dave


.


.
 
Keep the form open if you want to refer to a value in the form control. My
suggestion was to create a new column that references the form control. You
can then use this new column like you would any other field. The criteria
should have the same Forms!frm...!txt... under the appropriate column.

--
Duane Hookom
Microsoft Access MVP


Dave said:
I close the report dialog form right after i do the
DoCmd.OpenReport.

I guess I'm not sure how I get the parameter value from
the dialog form to the calculated column in the query? Do
I just specify the reference to the dialog form field in
the query? And my next question would then be how do I
reference that calculated column on the header of the
report. Would I set the control value of the field to the
calculated query?

Thanks,

Dave


-----Original Message-----
When do you close the form?
The calculated column in the query allows you to reference the new column in
your report rather than the form control. You would be able to use
[DiaField] rather than Forms!...

--
Duane Hookom
Microsoft Access MVP


Dave said:
Yes, I do have code that closes the dialog. The issue is
not in generating the report with the parameters. I do
that via the DoCmd.OpenReport and pass the dynamically
created where clause which works fine. It's just in
printing the parameters on the header page.

I'm not sure if your suggestion of using a calculated
column is for the report filter or printing the parameters
on the main page? How exactly would you use the
calculated column to get the parameters printed on the
header page?

Thanks,

Dave


-----Original Message-----
Do you have any code that closes the dialog form? You can
create a
calculated column in your query:
DiaField:Forms!DialogForm![DialogField]

--
Duane Hookom
MS Access MVP


I have a set of reports that I pass dynamic parameters
to
based on user input to a report dialog form. I print
these parameters on the header of the report so the user
will know what they entered to filter the report.

On the report, I reference them via the Control Source -
e.g. Forms!DialogForm![DialogField] Everything works
well. When I preview the report, the passed parameters
show up on the report. However, when I then print the
same report, the parameters no longer show up. I just
get
the #Name? where I had the valid report parameter
values.
I know this is because it cannot reference them, but I
am
unsure as to why since I could see them in the preview
of
the report.

Any ideas or solutions so that I can have these values
printed on the report?

Thanks,

Dave


.


.
 
Back
Top