Results 1 to 4 of 4

Thread: DLookup Help

  1. #1
    Join Date
    Oct 2003
    Location
    Charlotte, NC
    Posts
    2

    Unanswered: DLookup Help

    I have created a combo box that pulls the "Vendor Number" from the "Vendor List" table. The "Vendor Number" is stored in the "Vendor ID" on my "Budget" form. I want to use the DLookup to add the "Vendor Names" from the "Vendor List" table to the "Vendor Name" in my Budget form.

    I have tried everything I can to do this.....my latest attempt :

    =DLookUp("[Vendor Names]","Vendor List","[Vendor ID] =
    " & [Vendor List]![Vendor Number])

    I get a #Name? error.

    Any and all help would be GREATLY appreciated.

    Thanks,
    JimmyY

  2. #2
    Join Date
    Oct 2003
    Posts
    706

    Lightbulb

    It is quite possible that one of the names used here are ambiguous. MS-Access routinely names an object on the form with a name equal to the name of the database field it refers to... and thereby routinely gets itself confused. [Vendor List], for example, could refer both to a database field and a control on the form. You'd suppose that MS-Access would be able to handle the ambiguity and in some places it can, some places it can't. Try fiddling with object-names on the form.
    ChimneySweep(R): fast, automatic
    table repair at a click of the
    mouse! http://www.sundialservices.com

  3. #3
    Join Date
    Oct 2003
    Location
    Charlotte, NC
    Posts
    2
    I tried renaming every field name with new names.....now the #Error appears.

    Obviously, I'm new to this.....the DLookup goes in the Control Source line in the properties, correct ?

    Please help!!! A detailed explanation of the proper use of DLookup would be greatly appreciated.

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    suggestion 1: make your life easy and avoid spaces & hyphens in names (names of tables/fields/forms/controls/reports/queries).
    InitialCapitalisationOfEachWord is the easiest to read (..for me)
    underline_between_words works but looks ugly and is tough to read.

    suggestion 2: if you ignore suggestion 1, enclose all your names in []

    try:
    =DLookUp("[Vendor Names]","[Vendor List] etc

    izy

Posting Permissions

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