Results 1 to 9 of 9
  1. #1
    rmlcal1@aol.com is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    10

    How to populate a field in a form using a query


    I have a form based on a Charity List table and one of the fields in the table is NTEE_CODE1. There is another table that has all the NTEE codes with a description. I would like the description to display on the form. Below is the SQL that
    was generated using query design. How do i connect the SQL with the field in the form so the description is displayed?


    SELECT [NTEE CODES].DESCRIPTION
    FROM [NTEE CODES] INNER JOIN [Charity List] ON [NTEE CODES].NTEE_CODE = [Charity List].NTEE_CODE1
    WHERE (([Charity List].[NTEE_CODE1]=[NTEE CODES].[NTEE_CODE]));

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rmlcal1@aol.com is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    10
    Quote Originally Posted by pbaldy View Post
    Thanks.. But it doesn't help for what I need to do

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Perhaps you could tell us in plain English what you need to do.
    Even post a copy of your database as a zip file.

    In your sql example , your inner join and where clause criteria seem redundant.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by rmlcal1@aol.com View Post
    Thanks.. But it doesn't help for what I need to do
    I suspect it would, but how about:

    =DLookup("DESCRIPTION", "QueryName")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    rmlcal1@aol.com is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    10
    Click image for larger version. 

Name:	Form Question_Page_1.jpg 
Views:	8 
Size:	120.2 KB 
ID:	34417
    Click image for larger version. 

Name:	Form Question_Page_3.jpg 
Views:	8 
Size:	46.0 KB 
ID:	34419
    Click image for larger version. 

Name:	Form Question_Page_4.jpg 
Views:	8 
Size:	25.9 KB 
ID:	34421
    Attached Thumbnails Attached Thumbnails Form Question_Page_2.jpg  

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If you change your code textbox to a combo, you can use the link I first posted. It's more efficient than a DLookup().
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    rmlcal1@aol.com is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2018
    Posts
    10
    All I want to do is display a description. I do not want to display a list of options that the user can choose from . I am not sure whyyou are recommending using a combo box

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Using a combo forces the user to enter or select a valid option. If you don't want to use one, you can use DLookup() but would need a criteria:

    DLookup Usage Samples
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Populate Field in a Entry Form
    By BADebbie in forum Forms
    Replies: 18
    Last Post: 06-22-2017, 04:36 PM
  2. Replies: 2
    Last Post: 05-17-2017, 06:17 AM
  3. Replies: 1
    Last Post: 09-16-2014, 12:32 PM
  4. Populate Calculated field in query
    By Mpike926 in forum Access
    Replies: 25
    Last Post: 09-07-2012, 11:04 AM
  5. Replies: 3
    Last Post: 10-03-2011, 02:33 PM

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