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.
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.
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.
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.
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.
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:
and I'm back to getting the #Name? error.
Is there a step I'm missing?
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?
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.
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?
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.
Try changing the control source to "WkHrs"" (no quotes).I did add a text box on the form "frmEvent" to display the work hours, and the control source is "=WkHrs"
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.
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.