By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,155 Members | 2,518 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,155 IT Pros & Developers. It's quick & easy.

What is wrong with my DLookup?

P: 3
Hello...
I am trying to use a Dlookup as a control sorce of a text box. What I want to do is look up the name of an apple species in the apple table when the apple.appleID (in the table) = the appleID on the fruit form.

the apple_name text box is also on the fruit from.

Then when I find that name I want it to populate my text box.


This is the code that I have tried so far and I get an "#Error" message in the field.
=DLookUp("[appleName]","tbl_apple","[tbl_apple]![appleID]=[Forms]![frm_fruit_Entries]![txtappleID]")

I have tried to search around the other post, so I hope this question is not a repeat. Thanks in advance for the help.
Nov 17 '06 #1
Share this Question
Share on Google+
5 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Try this ...

=DLookUp("[appleName]","tbl_apple","[appleID]=" & [Forms]![frm_fruit_Entries]![txtappleID])

Hello...
I am trying to use a Dlookup as a control sorce of a text box. What I want to do is look up the name of an apple species in the apple table when the apple.appleID (in the table) = the appleID on the fruit form.

the apple_name text box is also on the fruit from.

Then when I find that name I want it to populate my text box.


This is the code that I have tried so far and I get an "#Error" message in the field.
=DLookUp("[appleName]","tbl_apple","[tbl_apple]![appleID]=[Forms]![frm_fruit_Entries]![txtappleID]")

I have tried to search around the other post, so I hope this question is not a repeat. Thanks in advance for the help.
Nov 18 '06 #2

NeoPa
Expert Mod 15k+
P: 31,616
Just a guess, but as the field used is named txtappleID, I think it may be a string rather than a number (those delimiters again ;) ) in which case it should be
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("[appleName]","tbl_apple","[appleID]='" & [Forms]![frm_fruit_Entries]![txtappleID] & "'")
Nov 18 '06 #3

alpnz
100+
P: 113
Just a guess, but as the field used is named txtappleID, I think it may be a string rather than a number (those delimiters again ;) ) in which case it should be
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("[appleName]","tbl_apple","[appleID]='" & [Forms]![frm_fruit_Entries]![txtappleID] & "'")
A similar situation to my own question, which might help as well.
Follow this link

Mary mentioned the same thing, re Delimiters.
Nov 18 '06 #4

P: 3
Bre
Thank you all so much for thel help, but for some reason I am not getting anything back in my text box. I have put the code in the on update of the first criteria field text box. And I am not getting anything back. I have checked the spelling and all looks fine. any suggestions?
Nov 21 '06 #5

MMcCarthy
Expert Mod 10K+
P: 14,534
Thank you all so much for thel help, but for some reason I am not getting anything back in my text box. I have put the code in the on update of the first criteria field text box. And I am not getting anything back. I have checked the spelling and all looks fine. any suggestions?
Post the section of code here as you are currently using it.

We may see something you missed.
Nov 21 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.