Results 1 to 2 of 2
  1. #1
    doquan0 is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    2

    Dlookup Problem in Access 2007

    Hi, I'm not a native English speaker, please sympathize for my poor writing.

    Please have a look at my database (in my attachment or you can download from: http://www.mediafire.com/?yq4qqgc6j830qgu )

    In form1, I want Text13 show email of the customer. The email can be retrieved from table tbl_Customer


    However, I tried to use
    Code:
    =Dlookup("Email","tbl_Customer","CustomerID="&CustomerID
    but it did not work.

    I don't know whether it is a problem in my database or in Dlookup function.
    Please help me
    Thanks a million.

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Well here is a suggestion without looking at your database is your CustomerID field type is Text or Integer.

    I assume u and you have a a a text Box on that form bound to CustomerD

    I will type this code to the Cotrol Source of text box 13

    When CustomerID is integer:

    =DLookUp("[Email]","tbl_Customer","[CustomerID]=" & [Forms]![form1]![CustomerID])

    When CustomerID is Text:

    =DLookUp("[Email]","tbl_Customer","[CustomerID]='" & [Forms]![form1]![CustomerID] & "'")

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

Similar Threads

  1. Replies: 1
    Last Post: 03-29-2010, 10:23 AM
  2. Replies: 1
    Last Post: 03-18-2010, 09:12 AM
  3. Problem with label in Access 2007
    By Madraykin in forum Forms
    Replies: 4
    Last Post: 02-04-2010, 10:41 AM
  4. Access 2007 Users and Permissions Problem
    By botts121 in forum Security
    Replies: 3
    Last Post: 07-06-2009, 10:23 AM
  5. Problem using the combo box Access 2007
    By PATATE in forum Access
    Replies: 11
    Last Post: 05-23-2009, 06:26 AM

Tags for this Thread

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