
Signature
Please Rate the posting if helps you
Thanks again for staying with me.
If I read you correctly, materials may be missing from the subform's fields?
No. This is taken directly from another table, not a query. Also, both fields
(description in taskMaterials table and materials in subfrmOptions) and the
table have correct spelling in the DLookup.
=DLookUp("[TableName].[price]","[taskMaterials]","[TableName].[description]=
' " &
[Forms]![frmNewQuote]![subfrmOptions].[Form]![materials] & " ' " )
isn't working.
Both materials and the DLookup textbox are in the subform.
Also, no difference with
=DLookUp("[price]","[taskMaterials]","[description]= ' " &
Me!materials & " ' " ) or
=DLookUp("[price]","[taskMaterials]","[description]= ' " &
Forms!subformOption.materials & " ' " )
If I use a (sub)subform based on a query instead of a DLookup, I'll need to
lookup another field for another calculation, so that's not really an option
either.
Any suggestions on where else to look? This punctuation thing has got me beat.
Thanks
> Hi,
>
[quoted text clipped - 24 lines]
> >Thanks, but I now have #Name? displayed in unitCost field. Do you have any
> >other suggestions please?
AccessVandal - 19 Sep 2007 09:48 GMT
So, your’re saying the subform RecordSource is not part of the DlookUp.
Does the control “material” is the name of the control? Check the "material"
properties under the Tab "Other" and look the Name field.
>kasab wrote:
>Thanks again for staying with me.
[quoted text clipped - 30 lines]
>> >Thanks, but I now have #Name? displayed in unitCost field. Do you have any
>> >other suggestions please?

Signature
Please Rate the posting if helps you
kasab - 19 Sep 2007 10:14 GMT
Yes, the Name property of the control that contains the data on the subform
that is used in the DLookup is "materials" as used in the DLookup.
The subform RecordSource is the quotes table that contains the field
"materials" (text datatype).
And the DLookup works fine in the (sub)form displayed in form view on its
own.
> So, your’re saying the subform RecordSource is not part of the DlookUp.
>
[quoted text clipped - 35 lines]
> >> >Thanks, but I now have #Name? displayed in unitCost field. Do you have any
> >> >other suggestions please?
BruceM - 19 Sep 2007 12:20 GMT
I think this line needs to be changed:
[Forms]![frmNewQuote]![subfrmOptions].[Form]![materials]
It should be:
[Forms]![frmNewQuote]![subfrmOptions].Form![materials]
"Form" after [subfrmOptions] should not have the square brackets, since it
is a property and not a field or control.
> Yes, the Name property of the control that contains the data on the
> subform
[quoted text clipped - 53 lines]
>> >> >have any
>> >> >other suggestions please?
AccessVandal - 19 Sep 2007 09:57 GMT
The other option that I can suggest is to use the "taskMaterials" table with
a materialID instead of using the "description" field as a lookup. Using the
"description" is a very bad idea to begin with. What if you have more than
one with the same description?
If all else fails, use the DlookUp to find a single item first, than with
that we'll try to narrow it down.
=DLookUp("[price]","[taskMaterials]","[description]= 'the description of the
material here'")
>kasab wrote:
>Thanks again for staying with me.
>If I read you correctly, materials may be missing from the subform's fields?
>No. This is taken directly from another table, not a query. Also, both fields
>(description in taskMaterials table and materials in subfrmOptions) and the
>table have correct spelling in the DLookup.

Signature
Please Rate the posting if helps you
AccessVandal - 19 Sep 2007 10:06 GMT
I like to add further, if the textbox "material" and if it is blank or empty
it will produce an error. Like what you have posted "#Error".
>kasab wrote:
>Thanks again for staying with me.

Signature
Please Rate the posting if helps you
kasab - 19 Sep 2007 10:36 GMT
Thanks. I'll split the taskMaterials table and see what happens then - if
this was the problem, I'll post in a day or 2. Thanks again.
> I like to add further, if the textbox "material" and if it is blank or empty
> it will produce an error. Like what you have posted "#Error".
>
> >kasab wrote:
> >Thanks again for staying with me.