Results 1 to 11 of 11
  1. #1
    Synergy.ron@gmail.com is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    washington
    Posts
    42

    Post dlookup makes me feel stupid;

    i've read the Access 2019 Bible, watched countless utube videos yet I can not get the dlookup function to work.....grrrrrr
    It is a membership app with a members table hooked 1 to many to addresses, there is no relatioship from the uszipcodes table. I want the user to type in a zip code which does a dlookup to fill in the city and state. sounds straight forward. Yes i have a u.s. zipcode table.
    Can you look at my file and tell me what I need to know to make it work? accdb attached
    Attached Files Attached Files

  2. #2
    Welshgasman is online now Expert
    Windows 10 Access 2007
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    669
    I cannot use the DB as I only have 2007
    However consider a combo for the zipcode, and also bring n city and state in it's source.
    Then you can just populate your textboxes with the values in the additional columns on the AfterUpdate event of the combo, as the DlookUp wuld have to be executed twice.\

    hth
    Please, please use # when posting code snippets.
    Cross Posting Etiquette: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?search_query=debug+access+vba



  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    2,692

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    15,509
    Is this a Sharepoint question??

    The zipcode field/control on the subform is really text68??
    The ST (state) field/control on the subform is combo66??

    It is unclear what you are trying to do given the data set up.

  5. #5
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,291
    "Primary" and "Type" are reserved words in Access and shouldn't be used for object names. Plus they are not very descriptive. "Primary" What?? "Type" of What??

    I would also get rid of the Look-ups at the table level.
    Maybe they work with Sharepoint, but since I have never even explored Sharepoint, I don't know.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    2,692
    I reworked this a bit. City/state auto lookup is working. I did not address the many table field value list lookups.
    Here's the DB: LodgeMembership-davegri-v01.zip

    Here's a look at the form:

    Click image for larger version. 

Name:	sync .png 
Views:	23 
Size:	46.9 KB 
ID:	44329

  7. #7
    Synergy.ron@gmail.com is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    washington
    Posts
    42
    yes, that is what i am after, but, i still do not know how to use dlookup to bring in the city and state from the zup code?????

  8. #8
    Synergy.ron@gmail.com is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    washington
    Posts
    42
    dave,
    i am new to this forum and just saw how you corrected my .zip files and posted it. thanks.

  9. #9
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    2,692
    Quote Originally Posted by Synergy.ron@gmail.com View Post
    dave,
    i am new to this forum and just saw how you corrected my .zip files and posted it. thanks.
    You're welcome. Glad to help. Any more problems, give a shout.

  10. #10
    Synergy.ron@gmail.com is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    washington
    Posts
    42
    it looks like setting a relationship frpm zipcodes tp members avoids having to use dlookup??? thanks for the lesson!

  11. #11
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    2,692
    Quote Originally Posted by Synergy.ron@gmail.com View Post
    it looks like setting a relationship frpm zipcodes tp members avoids having to use dlookup??? thanks for the lesson!
    No, zipcodes are not related to members, they're related to addresses (the Addresses are related to the members). The method used is to make the query qCSZ the recordsource for the address subform, subfrmAddress.

    Click image for larger version. 

Name:	csz .png 
Views:	19 
Size:	48.8 KB 
ID:	44332
    Last edited by davegri; 02-20-2021 at 04:27 PM. Reason: clarif, I hope

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

Similar Threads

  1. Stupid Graphs or Stupid User.... you decide
    By rpeare in forum Reports
    Replies: 11
    Last Post: 06-12-2019, 01:02 PM
  2. Duplicating a Report Look and feel
    By Bentley in forum Reports
    Replies: 1
    Last Post: 10-13-2016, 01:13 PM
  3. I feel I am missing something here...
    By Fixer in forum Programming
    Replies: 3
    Last Post: 06-05-2015, 06:28 AM
  4. Replies: 4
    Last Post: 08-22-2012, 11:49 AM
  5. Replies: 3
    Last Post: 02-09-2010, 03:50 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 - Senior Forums