Results 1 to 7 of 7
  1. #1
    ascool_asice is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2014
    Posts
    4

    Dlookup from another table in form not working

    Hi to all



    I am pretty new to access and this is the first database that I am trying to build after reading and watching a few video's online.

    The attached access file has only one form called 'caller' in it and that is the form I am having an concern with

    The form has a field called 'propertystatus' which I need it to populate from the table 'properties' I was wondering if someone could tel me why this dlookup is not working...

    Appreciate your help and support

    Thanks
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why does the Relationships builder have two copies of Property table joined to same field in Caller table?

    The dynamic parameter is within quote marks. Quote marks indicate literal text. Don't put variables within quotes.

    Also, the value of PropertyAddress combobox is ID, not PropertyAddress.

    DLookup("[Status]", "Property", "[ID]=" & [PropertyAddress])

    However, DLookup and VBA are NOT needed just to show value from Status. Include the Status field in the combobox RowSource. Change ColumnCount to 3 and ColumnWidths to 0";1";0.

    Expression in textbox ControlSource: =[PropertyAddress].[Column](2)
    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.

  3. #3
    ascool_asice is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2014
    Posts
    4
    Hi June7

    Thanks... The dlookup worked perfectly...

    Spent a lot of time on the other method that you have mentioned however could not get that to work.. if you are aware of any link which can help me that it would be great

  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,771
    Why wouldn't it work, what happens - error message, wrong results, nothing?

    Properties of the combobox:
    RowSource: SELECT ID, PropertyAddress, Status FROM Property ORDER BY PropertyAddress;
    ColumnCount: 3
    ColumnWidths: 0";2";0"

    Expression in textbox: =[PropertyAddress].[Column](2)

    At least could eliminate the VBA and put the DLookup expression directly in textbox ControlSource.
    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
    ascool_asice is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2014
    Posts
    4
    Hi June7

    I am not getting any error the text box remains blank..

    Attached the file again with what I have put in...it would it be awesome if you could check whats wrong with it...
    Attached Files Attached Files

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Column index begins with 0. The status is in third column so that is index 2.

    =[Contract Propert Address].[Column](2)

    Also need to check the Show box in the RowSource query for the Status field.
    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.

  7. #7
    ascool_asice is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2014
    Posts
    4
    wow this did it thanks a ton June7.

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

Similar Threads

  1. Three criteria in Dlookup not working?
    By dcdimon in forum Programming
    Replies: 5
    Last Post: 07-03-2014, 07:04 AM
  2. Yet Another Dlookup isn't working thread
    By g4tv4life in forum Programming
    Replies: 8
    Last Post: 02-07-2014, 01:15 PM
  3. DLookup Code Not Working
    By burrina in forum Forms
    Replies: 7
    Last Post: 02-21-2013, 10:36 PM
  4. DLookup isn't working
    By cec in forum Access
    Replies: 7
    Last Post: 12-28-2012, 12:21 PM
  5. Replies: 4
    Last Post: 05-09-2012, 07:20 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