Results 1 to 5 of 5
  1. #1
    alfrei is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    7

    Help with DLookup?

    Hi,



    I've created a form with an address line. The form currently populates the address based on the 1AddressLine1 table column (Table is call 'PhysicianList'). However, I realized the address data we have may not be accurate. So we've created an updated address column (2AddressLine1) in our table. I'd like the address line in the form to show the most recent address. Meaning, if there is something inputted in 2AddressLine1, it will pull from that field. If there is nothing in that field, I'd like the address line to pull from 1AddressLine1. How do I do this? Do I use DLookup? If so, could someone walk me through this??

    Thanks!!

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    use the nz function - something like

    dlookup("nz(2AddressLine1,1AddressLine1)",....

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    In the query ,
    IIF(isNull(addr2),addr1,addr2) as RecentAddr

  4. #4
    alfrei is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    7
    Thanks, but there would still be a value in 1AddressLine1. I just want the form to show the newest address (i.e., 2AddressLine1).

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    that is what both suggestions do.

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

Similar Threads

  1. Can DLookup be used together
    By shakya69 in forum Forms
    Replies: 7
    Last Post: 04-08-2016, 10:02 AM
  2. Shortening if / dlookup >0 / then dlookup
    By Jack Russel in forum Modules
    Replies: 1
    Last Post: 02-19-2016, 03:01 PM
  3. DLookup with value from CBO
    By excellenthelp in forum Access
    Replies: 6
    Last Post: 12-31-2014, 09:11 AM
  4. Should I be using Dlookup
    By parishpete in forum Programming
    Replies: 6
    Last Post: 11-08-2012, 05:39 AM
  5. DLookup Help
    By Alex Motilal in forum Queries
    Replies: 3
    Last Post: 01-17-2011, 02:01 PM

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