Results 1 to 5 of 5
  1. #1
    ngonzalz is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    5

    Datasheet - Pull in field value using ID linked to table

    Hello!

    I am creating a Datasheet of tasks where one field is linked to a main form using an ID. Need help pulling in another field value using that ID.

    tblShows
    ..ShowID
    ..Show Name

    frmTasks
    ..ID
    ..ShowID - How can I display the Show Name here?
    ..Task



    Thanks for your help!!

  2. #2
    John_G is offline VIP
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Try using Dlookup:

    =Dlookup("[Show Name]","tblShows","ShowID = " & me!ID)

    as the control source for the textbox to display the show name.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Another option if you use a combo:

    http://www.baldyweb.com/Autofill.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Or simply create a query linking the two tables by the ShowID.

  5. #5
    ngonzalz is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    5
    Quote Originally Posted by John_G View Post
    Try using Dlookup:

    =Dlookup("[Show Name]","tblShows","ShowID = " & me!ID)

    as the control source for the textbox to display the show name.
    Thanks so much, this did the trick.

    I was initially trying to put the code in the control source of the Show ID ... which obviously wasn't working.
    I created an unbound textbox, named it Show Name, used the following code:
    Code:
    =DLookUp("[Show Name]","Shows","[Show ID] = " & [Forms]![dtshtTasks]![Show ID])

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 08-10-2017, 12:53 AM
  2. Replies: 2
    Last Post: 03-07-2013, 04:50 PM
  3. Replies: 3
    Last Post: 12-06-2011, 11:32 AM
  4. Replies: 1
    Last Post: 01-22-2011, 12:23 PM
  5. Replies: 3
    Last Post: 09-15-2010, 12:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums