If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#Name? - Killing Me
I am totally lost. I have a query titled "Service Record Query" with a
calculated field - ServiceTime: DateDiff ("w",[DateIn],[DateOut]). The calculations work correctly in the query. I have a form titled "Employees" with a subform titled "Service Record". One of the fields in the Service Record subform is titled "Weeks Service". I have entered: =[ServiceRecordQuery]![ServiceTime] in the control source to pull in the data from the calculated field in the query, but get the #Name? error. Any help would be greatly appreciated. I know that I can put the calculation in the form, but really wanted to use it in the query so that I can use it in other places. -- JudyB |
#2
|
|||
|
|||
#Name? - Killing Me
You can not just point to a field in an existing static query to get the data.
The data is only available when the query is running. In this case I believe you may need to use a DLookup() to get the value you want. JudyB wrote: I am totally lost. I have a query titled "Service Record Query" with a calculated field - ServiceTime: DateDiff ("w",[DateIn],[DateOut]). The calculations work correctly in the query. I have a form titled "Employees" with a subform titled "Service Record". One of the fields in the Service Record subform is titled "Weeks Service". I have entered: =[ServiceRecordQuery]![ServiceTime] in the control source to pull in the data from the calculated field in the query, but get the #Name? error. Any help would be greatly appreciated. I know that I can put the calculation in the form, but really wanted to use it in the query so that I can use it in other places. -- RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro Please post back to this forum so all may benefit. Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200804/1 |
#3
|
|||
|
|||
#Name? - Killing Me
The query (and with it the calculated field) needs to be in the form's
Record Source. Presumably DateIn and DateOut pertain to the current subform record, or to the current main form record, but in any case with a connection to the record with which this calculation is to appear. "JudyB" wrote in message ... I am totally lost. I have a query titled "Service Record Query" with a calculated field - ServiceTime: DateDiff ("w",[DateIn],[DateOut]). The calculations work correctly in the query. I have a form titled "Employees" with a subform titled "Service Record". One of the fields in the Service Record subform is titled "Weeks Service". I have entered: =[ServiceRecordQuery]![ServiceTime] in the control source to pull in the data from the calculated field in the query, but get the #Name? error. Any help would be greatly appreciated. I know that I can put the calculation in the form, but really wanted to use it in the query so that I can use it in other places. -- JudyB |
#4
|
|||
|
|||
#Name? - Killing Me
Thank you for quick response. I had also tried using DLookup, but was not
successful with that either. I typed: =DLookUp"[ServiceTime]","[ServiceRecordQuery]") and the end result was #Error. Have any idea where I went wrong? -- JudyB "ruralguy via AccessMonster.com" wrote: You can not just point to a field in an existing static query to get the data. The data is only available when the query is running. In this case I believe you may need to use a DLookup() to get the value you want. JudyB wrote: I am totally lost. I have a query titled "Service Record Query" with a calculated field - ServiceTime: DateDiff ("w",[DateIn],[DateOut]). The calculations work correctly in the query. I have a form titled "Employees" with a subform titled "Service Record". One of the fields in the Service Record subform is titled "Weeks Service". I have entered: =[ServiceRecordQuery]![ServiceTime] in the control source to pull in the data from the calculated field in the query, but get the #Name? error. Any help would be greatly appreciated. I know that I can put the calculation in the form, but really wanted to use it in the query so that I can use it in other places. -- RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro Please post back to this forum so all may benefit. Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200804/1 |
#5
|
|||
|
|||
#Name? - Killing Me
VBA Help and this link should give you a better understanding of the Domain
function syntax. The other suggestion you received is a good one and should be considered. http://www.mvps.org/access/general/gen0018.htm JudyB wrote: Thank you for quick response. I had also tried using DLookup, but was not successful with that either. I typed: =DLookUp"[ServiceTime]","[ServiceRecordQuery]") and the end result was #Error. Have any idea where I went wrong? You can not just point to a field in an existing static query to get the data. The data is only available when the query is running. In this case I believe [quoted text clipped - 10 lines] form, but really wanted to use it in the query so that I can use it in other places. -- RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro Please post back to this forum so all may benefit. Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200804/1 |
#6
|
|||
|
|||
#Name? - Killing Me
Almost anytime you get that error, a field is missing in your query. Make
sure that filed is there and is working properly. Another thing is if your form and subform are not linked properly. Go to the form "container" (click on the outside edge of the form) and go to data, link master and child fields. You may not be linked properly or at all. "JudyB" wrote: I am totally lost. I have a query titled "Service Record Query" with a calculated field - ServiceTime: DateDiff ("w",[DateIn],[DateOut]). The calculations work correctly in the query. I have a form titled "Employees" with a subform titled "Service Record". One of the fields in the Service Record subform is titled "Weeks Service". I have entered: =[ServiceRecordQuery]![ServiceTime] in the control source to pull in the data from the calculated field in the query, but get the #Name? error. Any help would be greatly appreciated. I know that I can put the calculation in the form, but really wanted to use it in the query so that I can use it in other places. -- JudyB |
#7
|
|||
|
|||
#Name? - Killing Me
In this case I think the Control Source expression was at fault in that it
pointed to something Access couldn't identify. Even with [Queries]! in front of it there is no way for it to identify a particular record. From which record should it grab ServiceTime? However, if the fields are available on the form then they are part of the record source, so in that sense it is accurate to say the field was not in the query. "Golfinray" wrote in message ... Almost anytime you get that error, a field is missing in your query. Make sure that filed is there and is working properly. Another thing is if your form and subform are not linked properly. Go to the form "container" (click on the outside edge of the form) and go to data, link master and child fields. You may not be linked properly or at all. "JudyB" wrote: I am totally lost. I have a query titled "Service Record Query" with a calculated field - ServiceTime: DateDiff ("w",[DateIn],[DateOut]). The calculations work correctly in the query. I have a form titled "Employees" with a subform titled "Service Record". One of the fields in the Service Record subform is titled "Weeks Service". I have entered: =[ServiceRecordQuery]![ServiceTime] in the control source to pull in the data from the calculated field in the query, but get the #Name? error. Any help would be greatly appreciated. I know that I can put the calculation in the form, but really wanted to use it in the query so that I can use it in other places. -- JudyB |
Thread Tools | |
Display Modes | |
|
|