#Name? on a report

G

Guest

I have the following control sources for two of my text boxes on my report.
If my report runs more than one page then instead of the correct data showing
in those two boxes I get the "#NAME?" error in the text boxes. But on page
one it shows the correct data. It only does this on page 2, etc. Any idea why
it would only show this error in those text boxes on multiple pages and not
page 1?

TextBox1
=IIf(IsNull(Forms!frmReportSelect!cboDept)=True,"All
Departments",Forms!frmReportSelect!cboDept)

TextBox2
=Forms!frmReportSelect!cboMonth
 
F

fredg

I have the following control sources for two of my text boxes on my report.
If my report runs more than one page then instead of the correct data showing
in those two boxes I get the "#NAME?" error in the text boxes. But on page
one it shows the correct data. It only does this on page 2, etc. Any idea why
it would only show this error in those text boxes on multiple pages and not
page 1?

TextBox1
=IIf(IsNull(Forms!frmReportSelect!cboDept)=True,"All
Departments",Forms!frmReportSelect!cboDept)

TextBox2
=Forms!frmReportSelect!cboMonth

You get the #Name error when Access cannot find the field entered in
the control source.
Somewhere, after the report starts, you have some code closing the
form.
 
G

Guest

The form does close when the report opens. That's the cause. Is there anyway
to pass this thru even though the form closes or does the form need to be
opened?
 
A

Arvin Meyer [MVP]

Instead of closing the form, hide it:

Me.Visible = False

in your report opening code.

Now close the form, when the report closes.
 

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