Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookup (Access 2000)

    Cannot use Lookup function


    I have copied the example from the Help in Access to build a dlookup,
    DLookup("[CompanyName]", "Shippers", "[ShipperID] = 1")
    i put the above in the control source of a control in a blank report,
    then i made the table shipper out of Shipperid and CompanyName,
    then i run the report and i receive a mesasage name?
    Where is is my mistake?

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookup (Access 2000)

    I don't know whether your post has a typing error, but the table and field name should be exact in both places. Shippers <> shipper and ShipperID <>Shipperid. If the data type of ShipperID is numeric, the criteria is fine, but if it is text, it should be "[ShipperID] = '1'". (enclose the 1 in single quotes).

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: DLookup (Access 2000)

    If this is in controlsource of a texbox, try putting an equal sign in front of the expression:
    =DLookup(...your stuff here...)

    Beyond that, I didn't understand what you meant by:
    >>then i made the table shipper out of Shipperid and CompanyName<<

    Also, you Dlookup will only work for the single ID=1 situation you specified.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •