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 Expression trouble



 
 
Thread Tools Display Modes
  #1  
Old January 14th, 2010, 03:29 AM posted to microsoft.public.access.forms
Pamela
external usenet poster
 
Posts: 193
Default 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  
Old January 14th, 2010, 03:43 AM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default 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  
Old January 14th, 2010, 03:59 PM posted to microsoft.public.access.forms
Pamela
external usenet poster
 
Posts: 193
Default 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  
Old January 14th, 2010, 05:14 PM posted to microsoft.public.access.forms
Pamela
external usenet poster
 
Posts: 193
Default 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  
Old January 14th, 2010, 06:58 PM posted to microsoft.public.access.forms
Tom Lake[_2_]
external usenet poster
 
Posts: 96
Default DLookup Expression trouble


"Pamela" wrote in message
...
Nevermind, I found a solution. Thanks!


How about posting it so others may learn?

Tom Lake

  #6  
Old January 14th, 2010, 10:03 PM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default 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

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 11:59 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.