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 Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Choice Option Filters Combo
Elizabeth Aldrich 
  
2 years ago
In a MS Access Form: When someone clicks the "active" or "inactive" radio button from a Choice Group, I want it to filter the options in a combo box. Both the Choice Group and Combo Box are in the header. From there, the user selects the parent, and it shows the details in the detail area of the form.

Right now I have the below code to occur via the On Mouse Down" event on the Choice Group.

StatusT is the Option Group.
ActiveO is option value 1 in option group.
Inactive0 is option value 2 in option group.
The field(s) in ParentInfo table are P_First_Name and P_Last_Name for the combo box. That same table is linked to the StatusT field.


Here is a link to an image where it shows what the form currently looks like: https://ibb.co/tqkWgkn

<CODE>Private Sub ViewO_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

Dim strCriteria As String

Dim strSQL As String

Select Case Me!ViewO

    Case 1
        strCriteria = "Active"
    Case 2
        strCriteria = "Inactive"

End Select

strSQL = "Select [P_First_Name] & ' ' & [P_Last_Name] As Customer From ParentInfo Where [StatusT] like '" & strCriteria & "*');"</CODE>

Elizabeth Aldrich OP  @Reply  
  
2 years ago

Elizabeth Aldrich OP  @Reply  
  
2 years ago
I do want to add if there is a recommended course or seminar, I should watch to solve this solution. Please advise.
Ludwig Willems  @Reply  
      
2 years ago
volgen :)
Kevin Yip  @Reply  
     
2 years ago
To update the combo box's content, you need to change its row source and requery the combo box.  The code you posted above does neither.  There is also an extra right parenthesis ")" in your strSQL that should be removed.  Then add these two lines to your code:

     Me.[Put your combo box's name here].RowSource = strSQL
     Me.[Put your combo box's name here].Requery

To use the MouseDown event, you need to check what button is pressed before it does anything.  E.g.:

     If Button = acLeftButton Then ...

I suggest you use the Click event because it is more suited for any clickable controls.  The user has to click and UNclick the mouse at the control in order for it to register.  So a mere mouse-down action is not enough.
Richard Rost  @Reply  
          
2 years ago
I wouldn't use the mouse down event; you could either use the click event like Kevin recommended, or even the after update event, which is the one I prefer because it will also run even if you use the keyboard.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access 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:56:22 PM. PLT: 1s