Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2015
    Posts
    51

    Question Answered: #name on print? but okay on preview

    I have a date range on a report that comes from a form (user chooses two dates and results are given for records in that range).
    The date range shows fine on the report, and print preview, but once printed all I get is a #name error.

    Any ideas?

  2. Best Answer
    Posted by Missinglinq

    "The Access Gnomes use #Name to indicate that they cannot find the Control/Field you're referring to. How, exactly, are you passing the start and end dates to the Report?

    If, for instance,

    • From the Report you're referencing the date Controls on the Form, using something like as Me.StartDate = Forms("YourFormName")!StartDate
    • The Form is Open while Previewing the Report
    • The Form is then Closed before actually Printing the Report


    you would get this error. If this is the case, you could do any one of a number of things:

    1. Leave the Form open until after the Report is Printed
    2. Assign the startdate and enddate to Global Variables (pre-2007 version) or TempVars (2007 and later versions)...then, in the Report, call these Global Variables/TempVars
    3. From the Form, send the two dates via the OpenReport Command, using the OpenArgs parameter...then, in Loading the Report... parse the two dates out, then assign them to Variables at the top of the Report Code.

    Obviously, #1, above, would be the simplest approach. The approach outlined in the first list is the only way I can think of for the Report to display the dates correctly, in ReportPreview, but not in Printing the Report.

    Once again, if this is not the case, explain, exactly, how you're passing these dates to the Report.

    Linq ;0)>"


  3. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    The Access Gnomes use #Name to indicate that they cannot find the Control/Field you're referring to. How, exactly, are you passing the start and end dates to the Report?

    If, for instance,

    • From the Report you're referencing the date Controls on the Form, using something like as Me.StartDate = Forms("YourFormName")!StartDate
    • The Form is Open while Previewing the Report
    • The Form is then Closed before actually Printing the Report


    you would get this error. If this is the case, you could do any one of a number of things:

    1. Leave the Form open until after the Report is Printed
    2. Assign the startdate and enddate to Global Variables (pre-2007 version) or TempVars (2007 and later versions)...then, in the Report, call these Global Variables/TempVars
    3. From the Form, send the two dates via the OpenReport Command, using the OpenArgs parameter...then, in Loading the Report... parse the two dates out, then assign them to Variables at the top of the Report Code.

    Obviously, #1, above, would be the simplest approach. The approach outlined in the first list is the only way I can think of for the Report to display the dates correctly, in ReportPreview, but not in Printing the Report.

    Once again, if this is not the case, explain, exactly, how you're passing these dates to the Report.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •