Re: DLookup Help
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 16:20:08 -0700
On Tue, 29 Nov 2005 22:47:48 +0100, AndyEduardo
<AndyEduardo.1za3hy@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>I want to say thanks to Allen Browne for his help...
>
>The problem now is as follow....
>
>I have one Form (Invoice) with one subform (Invoice's Details), when I
>select one client in the cbo of the form, the subform's cbo shows only
>the products by agreement.....
>
>Later, I used DLookup function (as Allen Browne recommended) (
>DLookup(expression, domain, [criteria]), but I need to use two
>criterias.....I understanded the terms -expression- and - domain-, and
>they work good, but when I select the product I need two criterias
>because two differents clients can to buy the same product with
>different price.
>then I did a querie with needed fields, and I said to criteria of the
>DLookup function [criteria1] and [criteria2], then Access said (In
>Spanish, sorry) Error 13 No Coinciden los tipos.....
>
>Help me Please
You can only use one criterion - but that criterion can contain
multiple expressions. It should be a valid SQL WHERE clause without
the word WHERE, and it can contain AND (if you want both of two
criteria to apply) or OR (if you want to look up the value if either
one of the criteria applies). For instance you could use
=DLookUp("[Price]", "[PriceList]", "[CustomerID] = " & [CustomerID] &
" AND [ProductID] = " & [ProductID])
This will produce a single string value such as
[CustomerID] = 319 AND ProductID = 44
when the values in the form are inserted.
I have no idea what your table looks like or what criteria you are
trying to use so I can't give a better example. Post with a
description if you need help.
John W. Vinson[MVP]
.
- References:
- DLookup Help
- From: AndyEduardo
- DLookup Help
- Prev by Date: Re: SQL string
- Next by Date: Re: Query to find differences in a record
- Previous by thread: DLookup Help
- Next by thread: Re: Text Spacing Problem in Access 2003
- Index(es):
Relevant Pages
|
|