DLookup

message from Chris on 30 May 2004
Can it be used multiple criteria for the DLookup function in the validation
rule for a control on a form?(Ex:For every control except the first one,
the values for the precedent controls from the form are equal with the
fields having the same name in a query)
Can you give me an example?
 
John Vinson replied to Chris on 30 May 2004
Yes; the third argument to DLookUp is a valid SQL WHERE clause without
the word WHERE. Anything you can use as a Query criterion - OR logic,
AND logic, nested parentheses, etc. - can be used in the DLookUP.

I'm not sure what you're asking here... but it sounds like you might
be storing data in fieldnames, never a good idea! Can you describe
what exactly you are trying to look up?

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 
Chris replied to John Vinson on 3 Jun 2004
Here is what I'm trying to do. Can you help me?

In the control 2 of the form must be allowed just these values for which
the field 1 from the query is equal whith the value introduced in the
control 1 in the form
In the control 3 of the form must be allowed just the values for which the
field 2 from the query = the value value introduced in the control 2 in the
form and the field 1 from the query =the value introduced in the control 1
in the form
In the control 4 of the form must be allowed just the values for which the
field 3 from the query = the value value introduced in the control 3 in the
form, the field 2 from the query = the value value introduced in the
control 2 in the form and the field 1 from the query =the value introduced
in the control 1 in the form
.. and so on
The most controls of the form are combo boxes whith the lists of values
selected from the same tables from which are added the values from the table
the query is based on.
Chris

"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:drgkb094q2iistf5a1mto4e627u69dfr98@4ax.com...
 
Chris replied to John Vinson on 2 Jun 2004
Ex: In the control 2 of the form must be allowed just these values for which
the field 1 from the query is equal whith the value introduced in the
control 1 in the form
In the control 3 of the form must be allowed just the values for which the
field 2 from the query = the value value introduced in the control 2 in the
form and the field 1 from the query =the value introduced in the control 1
in the form
In the control 4 of the form must be allowed just the values for which the
field 3 from the query = the value value introduced in the control 3 in the
form, the field 2 from the query = the value value introduced in the
control 2 in the form and the field 1 from the query =the value introduced
in the control 1 in the form
.. and so on
The most controls of the form are combo boxes whith the lists of values
selected from the same tables from which are added the values from the table
the query is based on.
Chris

"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:drgkb094q2iistf5a1mto4e627u69dfr98@4ax.com...
 

Archived message: DLookup (Microsoft Access Forms)