Results 1 to 6 of 6
  1. #1
    Terava is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2013
    Posts
    6

    Dlookup problem

    Hi again. For some reason I can't get dlookup working.. Can some one help? http://sdrv.ms/122smYp there is the file.. And in toimittamattomat_kysely_L is Dlookup test field.. I try to get some customer info related to this box.. Addresses are in yhteystiedot. Can someone check what i do wrong..? -Jani

  2. #2
    Parsonshere is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2012
    Location
    Rusk
    Posts
    25
    Rename the combo box txtAsiakas so it's NOT the same as the field name.
    Use the combo box name, not the Label Caption in Dlookup statement.
    Tunnus is a long Integer and does not require delimiter " ' "
    =THaku("[Sukunimi]","Yhteystiedot","[Tunnus]=" & [Forms]![toimittamattomat_kysely_L]![txtAsiakas_tiedot])
    However, in my English Version, I did not get this to actually work - Don't know if it will.

  3. #3
    Terava is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2013
    Posts
    6
    thanx.
    Fixed combo box name.. I should be careful..
    Now it dosn't give error but still returns empty..
    New improved version in link.. ITS THE FIELD IN form: TILAUS-> MUOKKAUS55
    (next to that)

    Also tested in toimittamattomat_kysely_v3 in field muokkaus36 box
    There is used english version code..

    Now gives an error.. help.. I got it working in other place, so there is now still some error.. Does some one find it?
    -Jani



    Quote Originally Posted by Parsonshere View Post
    Rename the combo box txtAsiakas so it's NOT the same as the field name.
    Use the combo box name, not the Label Caption in Dlookup statement.
    Tunnus is a long Integer and does not require delimiter " ' "
    =THaku("[Sukunimi]","Yhteystiedot","[Tunnus]=" & [Forms]![toimittamattomat_kysely_L]![txtAsiakas_tiedot])
    However, in my English Version, I did not get this to actually work - Don't know if it will.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    I downloaded the file but not seeing the edits recommended by Parsonshere. Not finding anything with the exact name toimittamattomat_kysely_L.

    Not sure I would use DLookup.

    Options:

    1. multi-column combobox to hold the address info

    2. form RecordSource that joins the two tables, then bind textboxes to the fields from yhteystiedot, set properties Locked Yes and TabStop No
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Parsonshere is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2012
    Location
    Rusk
    Posts
    25
    =DLookUp("[Sukunimi]","Yhteystiedot","[Tunnus]=" & [Asiakas_tiedot])
    I didn't really review the merits of your methods, but just to get the Dlookup working, this statement does work.
    You have the sql referencing itself, by using the combobox name where I have placed Asiakas_tiedot in the statement.
    Again, watch the control names to make sure they are not the same as the field name.
    When you rename the control, the statement will automatically change(Unless you change the default option),
    so after renaming a control, check the statement or clauses that referenced them again.

  6. #6
    Terava is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2013
    Posts
    6
    Hi. These solved my problem.. Thank you all for helping me!!!
    -Jani

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

Similar Threads

  1. DLookUP problem
    By Symlink in forum Access
    Replies: 7
    Last Post: 03-28-2013, 11:03 AM
  2. Problem with DLookup
    By MichealShinn in forum Programming
    Replies: 5
    Last Post: 01-25-2012, 09:08 AM
  3. DLookup problem
    By the_rock in forum Programming
    Replies: 3
    Last Post: 01-11-2012, 02:36 AM
  4. Using Dlookup problem
    By Lupson2011 in forum Access
    Replies: 5
    Last Post: 12-07-2011, 10:33 AM
  5. Dlookup problem
    By CalifDan in forum Reports
    Replies: 4
    Last Post: 12-09-2009, 06:09 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