PC Review


Reply
Thread Tools Rate Thread

DLookUp Criteria in a query

 
 
=?Utf-8?B?TFBD?=
Guest
Posts: n/a
 
      24th Feb 2006
Hi, please help me with this problem. I have a table (Family Members)
containing ID, FullName and IDFamilyRelationship fields. For example, Mr. Ian
Roberts has the ID nÂș 2010001 and his wife, Mrs. Rosa Morales's ID is
2010002. Therefore, the IDFamilyRelationship of Mr. Ian is 2010002 and that
of Mrs. Rosa is 2010001. Now, I want to create a QUEYRY based on this table
showing its 3 fields and, ADDITIONALLY, a new field named SPOUSE, using the
DLookUp Function, with the following syntax:
DLookUp("[FullName]";"Family Members";"[IDFamilyRelationship]=[ID]"), in
order to show the spouse's name in the same record row of the person in
question (Eg.: In the row concerning Mr. Ian Roberts, the column SPOUSE
should indicate the name Rosa Morales, but there is now result. This DLookUp
function works well if the criteria is fixed (eg. ID=2010001), or if this
criteria is set in a form or report (where we can use the control name), but
I can't find the way to give a criteria that is not fixed in a QUERY. So,
please help. I would very much appreciate it.
 
Reply With Quote
 
 
 
 
Larry Daugherty
Guest
Posts: n/a
 
      24th Feb 2006
Try
DLookUp("[FullName]";"Family Members";"[IDFamilyRelationship]=" &
[Me.IDFamilyRelationship]),

HTH
--
-Larry-
--

"LPC" <(E-Mail Removed)> wrote in message
news:2C86666B-9061-48F3-9D3F-(E-Mail Removed)...
> Hi, please help me with this problem. I have a table (Family

Members)
> containing ID, FullName and IDFamilyRelationship fields. For

example, Mr. Ian
> Roberts has the ID nș 2010001 and his wife, Mrs. Rosa Morales's ID

is
> 2010002. Therefore, the IDFamilyRelationship of Mr. Ian is 2010002

and that
> of Mrs. Rosa is 2010001. Now, I want to create a QUEYRY based on

this table
> showing its 3 fields and, ADDITIONALLY, a new field named SPOUSE,

using the
> DLookUp Function, with the following syntax:
> DLookUp("[FullName]";"Family

Members";"[IDFamilyRelationship]=[ID]"), in
> order to show the spouse's name in the same record row of the person

in
> question (Eg.: In the row concerning Mr. Ian Roberts, the column

SPOUSE
> should indicate the name Rosa Morales, but there is now result. This

DLookUp
> function works well if the criteria is fixed (eg. ID=2010001), or if

this
> criteria is set in a form or report (where we can use the control

name), but
> I can't find the way to give a criteria that is not fixed in a

QUERY. So,
> please help. I would very much appreciate it.



 
Reply With Quote
 
=?Utf-8?B?TFBD?=
Guest
Posts: n/a
 
      27th Feb 2006
Hi, many thanks for the suggestion. I tried it but unfornately, I didn't
work. Access gave the following message: Syntax error (missing operator) in
query expression '[IDFamilyRelationship]='
Thanks again and in advance for other suggestions
"LPC" wrote:

> Hi, please help me with this problem. I have a table (Family Members)
> containing ID, FullName and IDFamilyRelationship fields. For example, Mr. Ian
> Roberts has the ID nÂș 2010001 and his wife, Mrs. Rosa Morales's ID is
> 2010002. Therefore, the IDFamilyRelationship of Mr. Ian is 2010002 and that
> of Mrs. Rosa is 2010001. Now, I want to create a QUEYRY based on this table
> showing its 3 fields and, ADDITIONALLY, a new field named SPOUSE, using the
> DLookUp Function, with the following syntax:
> DLookUp("[FullName]";"Family Members";"[IDFamilyRelationship]=[ID]"), in
> order to show the spouse's name in the same record row of the person in
> question (Eg.: In the row concerning Mr. Ian Roberts, the column SPOUSE
> should indicate the name Rosa Morales, but there is now result. This DLookUp
> function works well if the criteria is fixed (eg. ID=2010001), or if this
> criteria is set in a form or report (where we can use the control name), but
> I can't find the way to give a criteria that is not fixed in a QUERY. So,
> please help. I would very much appreciate it.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DLookup in Query Criteria steve Microsoft Access Queries 1 19th Dec 2006 05:08 PM
Dlookup Issue in Query Criteria =?Utf-8?B?RGF2ZSBL?= Microsoft Access Queries 5 5th Jan 2006 11:49 PM
Dlookup Issue in Query Criteria =?Utf-8?B?RGF2ZSBL?= Microsoft Access 2 5th Jan 2006 10:55 PM
DLookup hideously slow when used as query criteria alanh@synnex.com Microsoft Access Queries 1 28th Jan 2004 07:17 AM
DLookup Criteria David Microsoft Access Form Coding 1 2nd Oct 2003 05:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:42 PM.