Results 1 to 4 of 4
  1. #1
    zoinnk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    2

    Form title dlookup problem

    I have what I think should be a simple dlookup for a form title, but for some reason it does not work for me.

    I have two tables: tblCompany (main table) and tblContacts. The one-to-many relationship is established with a lookup field in tblContacts called Employer (that holds the Company_ID key but displays the value of CompanyName in tblCompany).

    The simple thing I'm trying to do is display the CompanyName value in a textbox in a form that filters for a single company. The closest I can get is displaying the Company_ID key (by simply setting the source to the Employer field). If I try to do the below dlookup, I simply get a #NAME error that I can't fix.



    =DLookUp([tblCompany]![CompanyName],[tblCompany],[tblCompany]![Company_ID]=[Employer])

    Does anyone have any suggestions? Thanks.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    *All* arguments to the Domain finctions are strings! http://access.mvps.org/access/general/gen0018.htm

  3. #3
    zoinnk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    2
    Thanks! That was easy.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help.

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

Similar Threads

  1. Replies: 6
    Last Post: 02-08-2011, 09:22 PM
  2. Newbie Dlookup problem
    By opopanax666 in forum Programming
    Replies: 7
    Last Post: 08-13-2010, 05:47 AM
  3. dlookup function problem
    By bdaniel in forum Programming
    Replies: 3
    Last Post: 04-26-2010, 05:55 AM
  4. Dlookup problem
    By CalifDan in forum Reports
    Replies: 4
    Last Post: 12-09-2009, 06:09 AM
  5. I have Problem in processing Dlookup Function
    By Katada in forum Programming
    Replies: 2
    Last Post: 04-23-2006, 12:07 AM

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