A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DLookup



 
 
Thread Tools Display Modes
  #1  
Old May 30th, 2004, 05:44 PM
Chris
external usenet poster
 
Posts: n/a
Default DLookup

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?


  #2  
Old May 30th, 2004, 09:28 PM
John Vinson
external usenet poster
 
Posts: n/a
Default DLookup

On Sun, 30 May 2004 19:44:17 +0300, "Chris" wrote:

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?

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public

  #3  
Old June 2nd, 2004, 01:09 PM
Chris
external usenet poster
 
Posts: n/a
Default DLookup

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" wrote in message
...
On Sun, 30 May 2004 19:44:17 +0300, "Chris" wrote:

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?

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public



  #4  
Old June 3rd, 2004, 05:57 AM
Chris
external usenet poster
 
Posts: n/a
Default HELP!!! DLookup

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" wrote in message
...
On Sun, 30 May 2004 19:44:17 +0300, "Chris" wrote:

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?

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.