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? 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
|
|||
|
|||
#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
|
|||
|
|||
#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 | |
|
|