> DLookup("[Tipo_medida]";"Tipo_artigos_stock";"[Tipo_Familia_Stock]= " &
> Me.[Familia].Value & " And [Tipo_SubFamilia_Stock]= " &
> Me.[SubFamilia].Value
> & " And [Refª_artigo]= " & Me.[refª_produto].Value)
>
> Now it tells me that a operator is missing. The values are in controls on
> a
> form witch are numeric.
>
> Thank you
>
> "Ken Snell (MVP)" wrote:
>
>> I can tell you that your syntax is wrong in the DLookup expression. The
>> generic syntax for multiple criteria is this:
>>
>> DLookup("FieldToLookUp", "TableOrQueryName", "Field1 = AValue And Field2
>> =
>> AnotherValue")
>>
>> or (if you're using controls on a form to give the values, and those
>> values
>> are numeric:
>>
>> DLookup(("FieldToLookUp", "TableOrQueryName", "Field1 = " &
>> Me.ControlNameOnForm.Value & " And Field2 = " &
>> Me.AnotherControlNameOfnForm.Value)
>>
>> or (if you're using controls on a form to give the values, and those
>> values
>> are text:
>>
>> DLookup(("FieldToLookUp", "TableOrQueryName", "Field1 = '" &
>> Me.ControlNameOnForm.Value & "' And Field2 = '" &
>> Me.AnotherControlNameOfnForm.Value & "'")
>>
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>>
http://www.accessmvp.com/KDSnell/>>
>>
>> "jb" <jb[ at ]discussions.microsoft.com> wrote in message
>> news:49DB92BF-D09F-465A-9DC2-8E0AF75DD4FA[ at ]microsoft.com...
>> > Could you please see what is wrong with this formula, because it doesnt
>> > give
>> > the right result. I think the criteria isnt well written.
>> >
>> > DLookup("[Descrição_Artigo]";"Tipo_artigos_stock";"[Tipo_Familia_Stock]=[Familia]"
>> > and "[Tipo_SubFamilia_Stock]=[SubFamilia]" and
>> > "[Refª_Artigo]=[refª_produto]")
>> >
>> > thank you
>> >
>> >
>>
>>
>>