Consulting

Results 1 to 2 of 2

Thread: #Name? Error

  1. #1

    #Name? Error

    Hello,

    I have a form that has 5 rows for data to be entered into text boxes. The way that it is built is you enter the Start Time and the Finish Time and there is a box that calculates the total time by use of the formula: =DateDiff("n",[Start Time6],[Finish Time6])/60

    I want to add another text box that will then calculate all of the total time text boxes. I have the following formula that I entered in the text box:

    =DateDiff("n",Nz([START TIME6],0),Nz([Finish Time6],0))/60+DateDiff("n",Nz([START TIME7],0),Nz([Finish Time7],0))/60+DateDiff("n",Nz([START TIME8],0),Nz([Finish Time8],0))/60+DateDiff("n",Nz([START TIME9],0),Nz([Finish Time9],0))/60+DateDiff("n",Nz([START TIME10],0),Nz([Finish Time10]),0)/60

    The formula works the way it is supposed to but when I completely close out of the database and go into it I get the #Name? error in all of the calculated time boxes. If it delete the box that has the longer formula in it then the other go back to working the way that they are supposed to.

    How can I resolve this issue?

  2. #2
    VBAX Expert
    Joined
    Oct 2012
    Posts
    726
    Location
    Maybe try adding textboxes for each total one at a time e.g.

    me![tot6] =DateDiff("n",Nz([START TIME6],0),Nz([Finish Time6],0))/60
    me![tot7] =DateDiff("n",Nz([START TIME7],0),Nz([Finish Time7],0))/60
    etc

    that might show whichever field is causing the problem.

    If that helps you fix it you can then use, e.g. =[tot6]+[tot7]+[tot8]+[tot9]+[tot10]
    to get the overall total (which is also a lot easier to read.)

Posting Permissions

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