Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
ListBox sets SubForm filter
Adrian Spickler 
    
5 years ago
I'm putting together a basic setup for a Food Pantry.  Client_Info_Table and Event_Log_Table are much like RR's CustomerT and ContactT with the field Client_ID linking the 2 tables.  I have a Search/Listbox form for finding the client.  A subform is supposed to show the Event_Log for each client as you click on them in the listbox.  At the moment, the subform only seems to work for the first client in the list (Client_ID=1).  Clicking on any other client only shows a blank new record for Client_ID=1.  There are no errors.  I went through the troubleshooting except for reinstall Access and reinstall Windows.  The Event_Log_Query has [Forms]![Client_Search_Form]![SearchList] as the Client_ID criteria.  SearchList is the name of the listbox.  The OnClick event runs the following:

Private Sub SearchList_Click()
    [Event_Log_Query_subform].Requery
End Sub
  

Any direction would be appreciated.
Thanks,
Adrian
Alex Hedley  @Reply  
           
5 years ago
If you MsgBox [Forms]![Client_Search_Form]![SearchList] in your onclick event what shows?
Alex Hedley  @Reply  
           
5 years ago
Report Listbox might have some tips
Adrian Spickler OP  @Reply  
    
5 years ago
Thanks Alex.  I'll look at Report ListBox.  The MsgBox command you gave does return the Client_ID correctly for each client I click.
Scott Axton  @Reply  
        
5 years ago
Adrian in your form that has the list and the SubForm of the Events.  From Design Mode click on the subform and go to it's properties.  Make sure that the link fields are correct. See image below.
Scott Axton  @Reply  
        
5 years ago

Adrian Spickler OP  @Reply  
    
5 years ago
Thanks for the feedback Scott.  I do have the Link Fields set with both as Client_ID.  I think I'm going to give up on the subform idea and make a "Client Check-In" button that opens up the Event_Log in a new window.  This seems to be what RR does in his videos.  It seams to work fine for my purposes.  (I do prefer the look and flow of the subform though.)
Scott Axton  @Reply  
        
5 years ago
The code you have in the On Click is more than likely your issue.
[Event_Log_Query_subform].Requery  tells Access "go out an reload the info for this subform.
It will always just show the first record after it has done that.
Go watch this video it may help you working with list boxes:   Favorite Customers
Scott Axton  @Reply  
        
5 years ago
See screen shot below.  Is this what you are trying to do?
Pick the person then the records on the right belonging to that person update?

Go watch the video just posted today...  Relational Combo
There isn't much difference between a list box and a combo box.
Scott Axton  @Reply  
        
5 years ago

Scott Axton  @Reply  
        
5 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 7:37:36 PM. PLT: 1s