Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2006, 06:15 PM
Parasyke
Guest
 
Posts: n/a
Default 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!!!

  #2  
Old November 13th, 2006, 06:45 PM
kingston via AccessMonster.com
Guest
 
Posts: n/a
Default Re: struggling with DLookup

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:
Quote:
>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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles