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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
DLookup Expression trouble
I have a DLookup expression in my query that I want to return the
corresponding description (text) for a given ID (Autonumber, pk) in the query. My expression isn't returning the different values but rather for each one, regardless of the ID, it's returning the description that corresponds to ID #1 only. Please help me see what I'm missing. Here's my expression: DLookUp("[Parts]","[ltblParts]","[ID]=" & "[ltblParts.ID]") Thanks so much! Pamela |
#2
|
|||
|
|||
DLookup Expression trouble
Pamela,
If numeric... =DLookup("Parts", "tblParts", "[ID]=" & Me![ID]) If text... =DLookup("Parts", "tblParts", "[ID]='" & Me![ID] & "'") Also, confirm the name of your tblParts because you have ltblParts. -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Pamela" wrote in message ... I have a DLookup expression in my query that I want to return the corresponding description (text) for a given ID (Autonumber, pk) in the query. My expression isn't returning the different values but rather for each one, regardless of the ID, it's returning the description that corresponds to ID #1 only. Please help me see what I'm missing. Here's my expression: DLookUp("[Parts]","[ltblParts]","[ID]=" & "[ltblParts.ID]") Thanks so much! Pamela |
#3
|
|||
|
|||
DLookup Expression trouble
Hi Gina,
I realized right after I posted that I mistakenly posted this in Forms and not Queries. But since reposting is so frowned upon, I didn't want to repost even into Queries. This is an expression in my query so the Me![ID] format doesn't work. At this point, do you want to me repost into Queries, as it should be, or continue here to try to get help? And yes, ltblParts is correct. I have added the "L" to the beginning to signify that it is just a lookup table for my own ease but sorry to confuse. Thanks! "Gina Whipp" wrote: Pamela, If numeric... =DLookup("Parts", "tblParts", "[ID]=" & Me![ID]) If text... =DLookup("Parts", "tblParts", "[ID]='" & Me![ID] & "'") Also, confirm the name of your tblParts because you have ltblParts. -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Pamela" wrote in message ... I have a DLookup expression in my query that I want to return the corresponding description (text) for a given ID (Autonumber, pk) in the query. My expression isn't returning the different values but rather for each one, regardless of the ID, it's returning the description that corresponds to ID #1 only. Please help me see what I'm missing. Here's my expression: DLookUp("[Parts]","[ltblParts]","[ID]=" & "[ltblParts.ID]") Thanks so much! Pamela . |
#4
|
|||
|
|||
DLookup Expression trouble
Nevermind, I found a solution. Thanks!
"Pamela" wrote: Hi Gina, I realized right after I posted that I mistakenly posted this in Forms and not Queries. But since reposting is so frowned upon, I didn't want to repost even into Queries. This is an expression in my query so the Me![ID] format doesn't work. At this point, do you want to me repost into Queries, as it should be, or continue here to try to get help? And yes, ltblParts is correct. I have added the "L" to the beginning to signify that it is just a lookup table for my own ease but sorry to confuse. Thanks! "Gina Whipp" wrote: Pamela, If numeric... =DLookup("Parts", "tblParts", "[ID]=" & Me![ID]) If text... =DLookup("Parts", "tblParts", "[ID]='" & Me![ID] & "'") Also, confirm the name of your tblParts because you have ltblParts. -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Pamela" wrote in message ... I have a DLookup expression in my query that I want to return the corresponding description (text) for a given ID (Autonumber, pk) in the query. My expression isn't returning the different values but rather for each one, regardless of the ID, it's returning the description that corresponds to ID #1 only. Please help me see what I'm missing. Here's my expression: DLookUp("[Parts]","[ltblParts]","[ID]=" & "[ltblParts.ID]") Thanks so much! Pamela . |
#5
|
|||
|
|||
DLookup Expression trouble
"Pamela" wrote in message ... Nevermind, I found a solution. Thanks! How about posting it so others may learn? Tom Lake |
#6
|
|||
|
|||
DLookup Expression trouble
Pamela,
One... glad you got it! For future refrence when you want to *also* post to another section just put a comma and type the section, ie... ,microsoft.public.access.queries and it will cross post so it will show up in both forums. Two, can you post your solution so other can benefit? -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Pamela" wrote in message ... Nevermind, I found a solution. Thanks! "Pamela" wrote: Hi Gina, I realized right after I posted that I mistakenly posted this in Forms and not Queries. But since reposting is so frowned upon, I didn't want to repost even into Queries. This is an expression in my query so the Me![ID] format doesn't work. At this point, do you want to me repost into Queries, as it should be, or continue here to try to get help? And yes, ltblParts is correct. I have added the "L" to the beginning to signify that it is just a lookup table for my own ease but sorry to confuse. Thanks! "Gina Whipp" wrote: Pamela, If numeric... =DLookup("Parts", "tblParts", "[ID]=" & Me![ID]) If text... =DLookup("Parts", "tblParts", "[ID]='" & Me![ID] & "'") Also, confirm the name of your tblParts because you have ltblParts. -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Pamela" wrote in message ... I have a DLookup expression in my query that I want to return the corresponding description (text) for a given ID (Autonumber, pk) in the query. My expression isn't returning the different values but rather for each one, regardless of the ID, it's returning the description that corresponds to ID #1 only. Please help me see what I'm missing. Here's my expression: DLookUp("[Parts]","[ltblParts]","[ID]=" & "[ltblParts.ID]") Thanks so much! Pamela . |
Thread Tools | |
Display Modes | |
|
|