A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Name? - Killing Me



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2008, 06:28 PM posted to microsoft.public.access.forms
JudyB
external usenet poster
 
Posts: 46
Default #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  
Old April 16th, 2008, 06:53 PM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default #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  
Old April 16th, 2008, 07:01 PM posted to microsoft.public.access.forms
BruceM[_2_]
external usenet poster
 
Posts: 1,763
Default #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  
Old April 16th, 2008, 07:17 PM posted to microsoft.public.access.forms
JudyB
external usenet poster
 
Posts: 46
Default #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  
Old April 16th, 2008, 08:35 PM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default #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  
Old April 16th, 2008, 08:44 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default #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  
Old April 16th, 2008, 09:02 PM posted to microsoft.public.access.forms
BruceM[_2_]
external usenet poster
 
Posts: 1,763
Default #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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.