423,873 Members | 2,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,873 IT Pros & Developers. It's quick & easy.

Reports with unbound fields #Name? error

P: 16
I have a report that I create using unbound text boxes to link to an open form. When you click on a cmdbutton on the form the report is supposed to print out information from the form.

It works fine until I close the database and restart it. That is when I receive the #Name? error. Nothing that I have tried works to resolve the issue. My text box names do not include references to the information I am requesting in the control source (txtNme for field name and =reports![ReportName]![FieldName] for control source)

If anyone can help I would greatly appriciate it.

--Jason
Jul 22 '06 #1
Share this Question
Share on Google+
3 Replies


100+
P: 179
This can be caused when the name that you supplied as the source of the control's value is not valid. You use the ControlSource property to specify the source of the control's value. For example, you might have misspelled the name, or the source might have been renamed or deleted. You may also see #Name? in a control if you place an expression in the control's ControlSource property and you insert a space before the equal sign that starts the expression.

Make sure that all the fields specified in your ControlSource actually exist in the underlying table or the RecordSource..
As well, if you're using an expression in the ControlSource, make sure there's an equal sign in front of the expression.

Hope this helps.
comteck
Jul 22 '06 #2

P: 16
Comteck,

I triple checked my expression in the controlsource. It reads exactly as this:
=Forms!frmInputForm![PERSON SSN]

No space in front of the equal sign. I even used the expression builder to make sure I didn't mistype anything.

When I start a new report and just put one unbound box in and use this control source everything works until I close access and then open the file again. That is the only thing that triggers this and then it will not work again. It prints with the #Name? on the printout as well so I know it is just not in print preview that I am seeing this. I also have the form open while I am previewing this report so the data it is supposed to access is right there.

I am all out of ideas.

--Jason
Jul 24 '06 #3

P: 16
To all that contemplated this post:

I thank you for your thoughts and to comteck for your assistance. My problem did not exist with my unbound text box source controls. The problem was my loading and unloading of forms. I have two forms, both tied to tables. One form opens up first and when the user clicks a button to exit the other pops up. My code was not loading the second form correctly (the form that I was pulling the data for my report) and thus caused the #Name? error to display.

The correct code for me to use when my second form loaded was :
DoCmd.OpenForm "frmInputForm", acNormal
Placed under the Private Sub Form_Unload section of the first form. I was not using that code and my second form was not loading correctly. I could add, edit, and delete records but for some reason I could not run query's that were dependent on the data on the form or create unbound text boxes.

Again thank you.

--Jason
Jul 24 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.