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? error on Control Source from Query



 
 
Thread Tools Display Modes
  #1  
Old May 2nd, 2008, 07:39 PM posted to microsoft.public.access.forms
Sandy
external usenet poster
 
Posts: 924
Default #Name? error on Control Source from Query

I have a query (which is based on a sub query) as follows:

SELECT Max(t_costs.DelDate) AS MaxOfDelDate
FROM [q_MaxOfBBOMDeliveryDate-Sub] INNER JOIN t_costs ON
([q_MaxOfBBOMDeliveryDate-Sub].MaxOfBOMRev = t_costs.BOMRev) AND
([q_MaxOfBBOMDeliveryDate-Sub].Job_ID = t_costs.Job_ID) AND
([q_MaxOfBBOMDeliveryDate-Sub].BOMType = t_costs.BOMType);

The control source for my unbound field is:
=[q_MaxOfBBOMDeliveryDate]![MaxOfDelDate]

.... but this is giving me a #Name? error.

Format of the control is Medium Date

Your help would be appreciated.

thanks
sandra
  #2  
Old May 3rd, 2008, 04:17 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default #Name? error on Control Source from Query

Sandy,
use a dlookup to get the value for the unbound field.
set its control source =DLookup( "[MaxOfDelDate]", "NameOfQuery",
strCriteria)
build the strCriteria using the fields that uniquely identify the record on
your form.
Check out vba help on Dlookup.


Jeanette Cunningham -- Melbourne Victoria Australia


"Sandy" wrote in message
...
I have a query (which is based on a sub query) as follows:

SELECT Max(t_costs.DelDate) AS MaxOfDelDate
FROM [q_MaxOfBBOMDeliveryDate-Sub] INNER JOIN t_costs ON
([q_MaxOfBBOMDeliveryDate-Sub].MaxOfBOMRev = t_costs.BOMRev) AND
([q_MaxOfBBOMDeliveryDate-Sub].Job_ID = t_costs.Job_ID) AND
([q_MaxOfBBOMDeliveryDate-Sub].BOMType = t_costs.BOMType);

The control source for my unbound field is:
=[q_MaxOfBBOMDeliveryDate]![MaxOfDelDate]

... but this is giving me a #Name? error.

Format of the control is Medium Date

Your help would be appreciated.

thanks
sandra



  #3  
Old May 3rd, 2008, 05:28 PM posted to microsoft.public.access.forms
Sandy
external usenet poster
 
Posts: 924
Default #Name? error on Control Source from Query

Thanks, Jeanette - this worked perfectly.

I used
= DLookup( "[MaxOfDelDate]", "NameOfQuery")

with no criteria as that was already defined in the query, which returns
only one record and one field

:-)
s-

"Jeanette Cunningham" wrote:

Sandy,
use a dlookup to get the value for the unbound field.
set its control source =DLookup( "[MaxOfDelDate]", "NameOfQuery",
strCriteria)
build the strCriteria using the fields that uniquely identify the record on
your form.
Check out vba help on Dlookup.


Jeanette Cunningham -- Melbourne Victoria Australia


"Sandy" wrote in message
...
I have a query (which is based on a sub query) as follows:

SELECT Max(t_costs.DelDate) AS MaxOfDelDate
FROM [q_MaxOfBBOMDeliveryDate-Sub] INNER JOIN t_costs ON
([q_MaxOfBBOMDeliveryDate-Sub].MaxOfBOMRev = t_costs.BOMRev) AND
([q_MaxOfBBOMDeliveryDate-Sub].Job_ID = t_costs.Job_ID) AND
([q_MaxOfBBOMDeliveryDate-Sub].BOMType = t_costs.BOMType);

The control source for my unbound field is:
=[q_MaxOfBBOMDeliveryDate]![MaxOfDelDate]

... but this is giving me a #Name? error.

Format of the control is Medium Date

Your help would be appreciated.

thanks
sandra




 




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:59 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.