DLookup

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

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?
 
Can it be used multiple criteria for the DLookup function in the validation
rule for a control on a form?

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.
(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?

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?
 
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
 
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
 
Back
Top