Reports with unbound fields #Name? error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beat1078
    New Member
    • Jul 2006
    • 16

    Reports with unbound fields #Name? error

    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
  • comteck
    New Member
    • Jun 2006
    • 179

    #2
    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

    Comment

    • beat1078
      New Member
      • Jul 2006
      • 16

      #3
      Comteck,

      I triple checked my expression in the controlsource. It reads exactly as this:
      =Forms!frmInput Form![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

      Comment

      • beat1078
        New Member
        • Jul 2006
        • 16

        #4
        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 "frmInputFo rm", 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

        Comment

        Working...