DLookup Help

A

AndyEduardo

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
select one client in the cbo of the form, the subform's cbo shows onl
the products by agreement.....

Later, I used DLookup function (as Allen Browne recommended)
DLookup(expression, domain, [criteria]), but I need to use tw
criterias.....I understanded the terms -expression- and - domain-, an
they work good, but when I select the product I need two criteria
because two differents clients can to buy the same product wit
different price.
then I did a querie with needed fields, and I said to criteria of th
DLookup function [criteria1] and [criteria2], then Access said (I
Spanish, sorry) Error 13 No Coinciden los tipos.....

Help me Pleas
 
M

mscertified

I dont understand Spanish but the only error I could think of is that a
column name you specified is not in the table you are searching.
Check the syntax of your criteria clause. Are you sure you have the quotes
and brackets in the right place? The [] is supposed to be around table names
or column names not the entire criteria clause.

Dorian
 
J

John Vinson

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]
 
A

AndyEduardo

Thanks to John, I tried as you said and Access did it


Thank you very much for your help. I'm satisfied with your answe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top