Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 46
  1. #16
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234

    The expression in textbox ControlSource is: =[qryRelEventEmployee]![WkHrs],
    By "calculated field name," do you mean what is written in the box where the calculation is supposed to occur? If so, it's the same as the ControlSource.

  2. #17
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    As shown:
    Click image for larger version. 

Name:	Everything.png 
Views:	6 
Size:	36.8 KB 
ID:	21321

  3. #18
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    And just in case you need it, here's the query the form uses with the code written in: Click image for larger version. 

Name:	Query design view.png 
Views:	7 
Size:	25.2 KB 
ID:	21322

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Remove the query name prefix.

    =[WkHrs]

    By calculated field name I mean what you typed into the query Field cell as the name.

    A form can do data entry/edit for only one table. Why do you have so many tables in the form RecordSource?

    The textbox needs to be in the subform's footer section, not the main form. And the expression should be: =Sum([WkHrs])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Now both ControlSource and calculated field say "=[WkHrs]", and I'm still getting the #Name? error..

    I don't know why there are so many tables. I didn't create this database, I just took it over a couple weeks ago.

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    The image shows a form with a subform. The subform must have the query with the calculated field as its RecordSource. The textbox must be in the subform's footer section.

    A subform (or subreport) is created by placing a subform/subreport container control on another form/report. The container can have a SourceObject of table, query, form, or report.

    Close this form/subform then open the subform directly from the Navigation pane. Modify it as described and save. Then open the form/subform. OR click into the subform container to get to its SourceObject (in this case it is a form) and do edits there.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Ok, so I determined that I was using the incorrect RecordSource. I was supposed to be using qryEvent, not what I was using. However, when I got into qryEvent, I ran into a problem:

    The data I want is on tblRelEventEmployee, but that particular table isn't part of qryEvent. I showed the table, and inserted the code as before.

    However, now when I open up the event form, I get a popup box asking me what the start time and end times are. I linked tblRelEventEmployee in the query qryEvent (I thought), but it's not recognizing the start and end times....I added them to fields next to the code as shown:
    Click image for larger version. 

Name:	qryEvent.png 
Views:	6 
Size:	27.5 KB 
ID:	21323and I'm back to getting the #Name? error.
    Is there a step I'm missing?

  8. #23
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If you open the query "qryEvent", what do you see for the column "WkHrs"?

    Did you add a text box control on the form "frmEvent" to display the work hours?
    Do/can you see the hours?

  9. #24
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    This is going in circles and going nowhere. Your form/subform arrangement may not be correct. Including tblRelEventEmployee in this form's RecordSource will likely make the form non-functional for data entry/edit.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #25
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Since qryRelEventEmployee is not the RecordSource, I deleted the column "WkHrs." Instead, I have column "WkHrs" on qryEvent, which is the correct RecordSource. It says: "WkHrs: DateDiff("n", StartTime, EndTime)/60"

    I did add a text box on the form "frmEvent" to display the work hours, and the control source is "=WkHrs"

    I do not see hours, I see #Name?

  11. #26
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Quote Originally Posted by June7 View Post
    This is going in circles and going nowhere.
    I'm sorry you feel that way. I am aware that I haven't figured out the issue just yet, but I am learning an astounding amount here.

    I am unable to provide my db for analysis per my boss.

    Luckily, including tblRelEventEmployee in the form's RecordSource didn't seem to change anything in regards to data entry and edit. I really want to figure out how to make this work. I feel like I'm right on the cusp of it working.

  12. #27
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Actually, I have a minor success!! I now show hours instead of some error message!
    However, it's showing the hours for just one person, not the whole crew...
    Click image for larger version. 

Name:	success!.png 
Views:	5 
Size:	25.0 KB 
ID:	21324

  13. #28
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I did add a text box on the form "frmEvent" to display the work hours, and the control source is "=WkHrs"
    Try changing the control source to "WkHrs"" (no quotes).

    I have to agree with June. Since you do not know Access very well, it would help if you would post your dB for analysis.

  14. #29
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    3.01 Clean.zipCPV DB v.1.7 BE - Copy.zipOk, I may have rendered it completely worthless for analysis, but I have made it small enough to upload. I'm including both FE and BE.

  15. #30
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Quote Originally Posted by ssanfu View Post
    Do the times ever cross to the next day? If so, you will need the date component with the time.
    What do I include to get the date component with the time? I just saw one example where it would have been necessary.

Page 2 of 4 FirstFirst 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-14-2015, 09:37 AM
  2. Replies: 3
    Last Post: 04-07-2015, 10:37 AM
  3. Replies: 1
    Last Post: 05-07-2013, 12:01 PM
  4. Int in a summed field
    By tcheck in forum Access
    Replies: 4
    Last Post: 02-19-2011, 04:03 PM
  5. Replies: 0
    Last Post: 02-14-2007, 01:35 PM

Tags for this Thread

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