473,396 Members | 2,068 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,396 software developers and data experts.

struggling with DLookup

I have a form (I won't bore you with the details of the necessity of
this, but), I need to have a textbox that uses DLookup to get a value
from a table with both being keyed to a common field "DMSID".
Because of various issues I need to get the textbox to simply display
the "PICTUREPATH" stored in the "PicturePaths" table based on another
value present on my form.

I'd like to use something like:
DLookUp("[PICTUREPATH]","PicturePaths","[DMSID]"=Forms!MainForm!DMSID)

But I don't have a clue how to get this to appear in the textbox... I
tried putting it in the DataSource property, and fiddled a little with
coming up with an event to populate the textbox, but nothing has
worked... Any clues for this newbie? Thanks!!!

Nov 13 '06 #1
1 1531
Use the input control's AfterUpdate event with your expression:

Me.textbox = DLookUp("[PICTUREPATH]","PicturePaths","[DMSID]=" & Me.DMSID)

This assumes both textbox and DMSID are in the same form as the control
you're trying to set and that DMSID is a number. If DMSID is not a number
then you'll have to use something like:

Me.textbox = DLookUp("[PICTUREPATH]","PicturePaths","[DMSID]='" & Me.DMSID &
"'")

Parasyke wrote:
>I have a form (I won't bore you with the details of the necessity of
this, but), I need to have a textbox that uses DLookup to get a value
from a table with both being keyed to a common field "DMSID".
Because of various issues I need to get the textbox to simply display
the "PICTUREPATH" stored in the "PicturePaths" table based on another
value present on my form.

I'd like to use something like:
DLookUp("[PICTUREPATH]","PicturePaths","[DMSID]"=Forms!MainForm!DMSID)

But I don't have a clue how to get this to appear in the textbox... I
tried putting it in the DataSource property, and fiddled a little with
coming up with an event to populate the textbox, but nothing has
worked... Any clues for this newbie? Thanks!!!
--
Message posted via http://www.accessmonster.com

Nov 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

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...
6
by: JLM | last post by:
What am I missing here? I have a form where I enter a "Class Code". This value corresponds to what sits in table "class code descriptions" along with the "title" of each "class code." Key...
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...
8
by: Christine Henderson | last post by:
I have a problem using the above function in the following simplified circumstance: In the lookup table called "Klms Travelled" I have 3 fields, eg: Receiver Name Receiver Suburb ...
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: Don | last post by:
Can someone help me fix my DLookup problem. I'm far from proficiency with Access. I've been creating databases for several years for work with the help of many of you and trial and error. I have...
9
by: | last post by:
In my database I have a 'control table' in which basic info is stored about the application, for instance the application's path and the name of the company that is using it. In all of the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.