Results 1 to 3 of 3
  1. #1
    SteveHale is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    10

    DLookup from Another Table

    Hello everyone.



    My brain has deserted me.

    1. I have a Form that auto-populates the Field "Processor" and the Record Source is called "tblLog".

    2. Upon "Processor" being populated, I would like to have 2 text fields auto populated as well, "Unit" & "UnitCode".

    3. I have a dedicated a Table called "tblProcessors" that houses the "Unit" & "UnitCode" information. "tblProcessors" also has a "ProcessorInitials" field in where the values are identical to the values of "Processor" in the "tblLog" table.

    4. Here's what I have done:
    Code:
    Me.Unit = DLookup("Unit", "tblProcessors", "Processor = " & [ProcessorInitials])


    Any help is greatly appreciated and you all would be my MS Access Santa Claus. Thanks in advance.

    Merry Christmas and Happy Holidays!

    - Steve

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    you could just put

    = DLookup("Unit", "tblProcessors", "Processor = " & [ProcessorInitials])

    in the controlsource of your textbox, then you don't need any code

    my other comment would be that ProcessorInitials sound like it is text in which case you would use

    = DLookup("Unit", "tblProcessors", "Processor = '" & [ProcessorInitials] & "'")

  3. #3
    SteveHale is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    10
    Quote Originally Posted by Ajax View Post
    you could just put

    = DLookup("Unit", "tblProcessors", "Processor = " & [ProcessorInitials])

    in the controlsource of your textbox, then you don't need any code

    my other comment would be that ProcessorInitials sound like it is text in which case you would use

    = DLookup("Unit", "tblProcessors", "Processor = '" & [ProcessorInitials] & "'")

    Ajax!

    You are Santa Claus!!!

    Thanks Sant..., I mean Ajax!!!


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

Similar Threads

  1. DLookup in a table?
    By julessantana in forum Database Design
    Replies: 4
    Last Post: 04-20-2015, 04:11 PM
  2. Replies: 1
    Last Post: 03-22-2013, 03:33 AM
  3. Replies: 4
    Last Post: 05-09-2012, 07:20 AM
  4. Replies: 1
    Last Post: 08-13-2011, 12:03 AM
  5. Replies: 2
    Last Post: 02-14-2010, 01:38 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