Results 1 to 11 of 11
  1. #1
    timesscript is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    34

    Creating a form that will display records from a linked table

    Sorry that I'm no good at figuring out how to display my issue here. Below you see my form. The record source is currently a query that returns "inquirers" from a table of people. I have a list box that displays the names of all the inquirers, and after update will load the record of that name. What I want to add is another listbox, that once someone chooses a name, will populate with all the "inquiries" (Like tickets from a call center) that are under that name. I already have a separate table with inquiries that is related to the current table in a one-to many relationship (Many inquiries per inquirer). Then my ultimate goal is once they select the inquiry from the list box, that additional fields will fill with that inquiry information.

    I realize that I may need to base my form on another query... or something... my mind is kind of blown right now trying to figure it out. I'm sure it's simple in the long run...

    One problem is that if we change the record source to a query based on both the "inquirers" query and the "inquiries" table, we will end up with my existing list box displaying one line for every inquiry, instead of one for every inquirer, which will need to be fixed.

    Please untangle my knotted-up mind!



    Click image for larger version. 

Name:	Capture.PNG 
Views:	14 
Size:	26.8 KB 
ID:	20779

  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,652
    If you want two listboxes, they would work the same as combos (as long as the first is single-select):

    Baldy-Cascading Combos
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I should have added that you could have a subform as well. Master/child links would keep it in sync with the main form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    timesscript is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    34
    I don't want to go with a subform, but I went ahead and added both forms into my query, and used the GROUP by to make it so I only see one set of names in the first listbox. But I cannot seem to get anything to appear in the second listbox. Right now it is bound to the date field, and the first litbox afterupdate is supposed to requery it, but nothing appears. (WHat I want is you to choose the date and the appropriate inquiry will appear at the fields to the right.)

    Click image for larger version. 

Name:	Capture.PNG 
Views:	13 
Size:	36.7 KB 
ID:	20787

  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,652
    Hard to debug without knowing the row source, etc. Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    timesscript is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    34
    It actually has no row source, and the control source is set to "inquiry ID"- the primary key field of the inquiries table.

    I would have to clear out some real data I've been testing with to upload the database- based on what I've told you is there something I should try before I do that?

  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,652
    If the second listbox doesn't have a row source, why would anything appear in it? For a requery to work, it would have to have a row source query that referenced the first listbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    timesscript is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    34
    Yeah, I used a wizard and I see that that would not work. I do not know though how to create a query that references a listbox- can you give me an example of how that would work?

  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,652
    I did; the link in post 2.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    timesscript is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    34
    Ah. I was looking for a query that was saved as opposed to just SQL- but then I found out, and your example helped me out a lot! Thanks!

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help!
    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. Replies: 4
    Last Post: 03-02-2015, 07:54 PM
  2. Creating a form with a shared linked table
    By Jude Shellito in forum Access
    Replies: 2
    Last Post: 04-10-2014, 11:32 AM
  3. Replies: 3
    Last Post: 11-04-2012, 09:25 AM
  4. Creating a query to display a weeks records
    By shabbaranks in forum Queries
    Replies: 16
    Last Post: 01-05-2012, 09:27 AM
  5. Display Linked table Path
    By gg80 in forum Access
    Replies: 3
    Last Post: 10-14-2011, 10:02 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