473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

What is wrong with my DLookup?

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
5 1552
MMcCarthy
14,534 Expert Mod 8TB
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
32,556 Expert Mod 16PB
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
113 100+
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
Bre
3
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
14,534 Expert Mod 8TB
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

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

Similar topics

1
by: KLAU | last post by:
I have a field that retrieves information from an expression in a query. I have used a DLookup function to get the calculated field from the query. However, the relationship is 1-to-many so one...
11
by: Nick J | last post by:
Hi, I want t display several fields in one label box using the DLookUp function. I have tried using below but all I get is '-1' when I preview the report. Any idea's? =DLookUp("" And...
6
by: MLH | last post by:
Runtime error 13 - type mismatch. I get the above error when I create a text box control on a form named and I run the following code in a sub on that same form... If DLookup("", "tblUsers",...
4
by: MLH | last post by:
I have tried using DLookUp in this manner... If DLookUp("","tblClients","='2021234567'") Then MsgBox "Found it!" End If I am wondering if that is a misuse of the DLookUp command? Type...
2
by: ctyrrell | last post by:
I have read with interest the many discussions of the 3048 Error: Cannot open any more databases. I understand how the number of open Table ID's causes the problem. My question has to do with the...
11
by: MLH | last post by:
DLookup("", "tblPreliminaryVINs", "=Forms!frmVINODO!SerialNum") is giving me a Type Mismatch error. That's confusing to me and I don't know how to circumvent it. The field in...
2
by: boyleyc | last post by:
Hi all the following code works perfectly well. Basically it populates a series of check boxes on my form, depending on whether dlookup finds an associated record. The problem i have is that...
2
by: jonvan20 | last post by:
I have been having trouble with a simple Dlookup command that was Reccommended to me by a nice fellow named Vic, On the other hand I have statements like this that wont run they give me a run time...
15
by: rleepac | last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue This is a table used to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.