Results 1 to 7 of 7
  1. #1
    imintrouble is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Missouri, where frownin's a sport
    Posts
    127

    The last Road

    Hello all, and hopefully the last for a while.



    As i'm sure a notable group of these forums knows, I have been working on a project here at work, largely with the help provided here at Access Forums. Whenever I had a question, I asked it and was provided with a quick and informative answer. Now I have one last question, now that all of the other pieces of this puzzle have been layed in their correct places.

    In my report, I have a single text box at the bottom in the footer of my report. I also have a field which, for some of you who know, I just created which has a number like 3, 0, 1 etc. My new text box of my report is currently reporting an error, so I'm not sure what's wrong. Right now, the control source property for the txtBox is =Sum(Val(TimeWorked)) I was hoping this would add up all of the information in the TimeWorked field of the query this report is based off of.

    Once again Access Forums, and hopefully not for a while after this, any help would be greatly appreciated.

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Try using the Dsum function instead.

    Look here for the syntax.

    http://www.techonthenet.com/access/f...omain/dsum.php

    Alan

  3. #3
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    If the field is indeed named TimeWorked and you have a control on the report named TimeWorked (Access uses the field name for the control name when it places a control on the report, or form for that matter.) you need to change it so that it is something like txtTimeWorked which would be the CONTROL name but it would be bound to TimeWorked.

    Then, when you have renamed it, if you have Name AutoCorrect turned on (which I suggest turning off), then it will rename your field name in your control source to the control name. Change it back (and use brackets):

    =Sum(Val([TimeWorked]))

    (not sure you need Val in there though, but I left it anyway)

    So the main message is this - when ANY field is used inside a control source formula, you need to make sure that there is no control with the name of any of the fields on the report (in any section, doesn't matter).

  4. #4
    imintrouble is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Missouri, where frownin's a sport
    Posts
    127
    when i tried to add the code to the control source, i realized two things, one, i don't think your allowed to do calculations in the footer so i created a different box somewhere else with visibility turned off which is then referenced in the footer box, and that when i tried to type TimeWorked into the from the code, the dropdown box that usually comes up so that I might just tab to quickly place the right information in there, TimeWorked wasn't there. I don't know if this would mess with the overall return, but once again, I just don't know.

    EDIT**********

    I was curious if the sum code was even working so i turned on the visibility of the box, and saw that the hours were being added like they are supposed to. but that the total box in the footer is only displaying 0. Not sure why.
    Last edited by imintrouble; 11-04-2011 at 03:13 PM. Reason: figured something out

  5. #5
    imintrouble is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Missouri, where frownin's a sport
    Posts
    127
    Never mind, figured that part out. Now i'm wondering if theres a way to display the word "Hours" after the number

    EDIT*********

    Never mind, figured it out. this project is DONE!!!
    Last edited by imintrouble; 11-04-2011 at 03:18 PM. Reason: DONE

  6. #6
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by imintrouble View Post
    this project is DONE!!!
    Congratulations! It is a nice feeling to complete a project.


  7. #7
    imintrouble is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Missouri, where frownin's a sport
    Posts
    127
    Yes indeed. It is a truly remarkable feeling when you refresh the page and see you code working in full, and working right. I went to college for two years as a computer programmer - Web Design, so I know all about the feeling of getting some troublesome code finished. But it's a bit different when you finish at something thats not for a grade, but will actually be used in the real world.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums