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 Expert 7    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Many to Many selections
Tina Brown 
    
2 years ago
Hi is there any way to make a selection disappear on the continueous form once its been selected?  So when they go to the next line, what they selected previously no longer shows up as a choice.
Ludwig Willems  @Reply  
      
2 years ago
create your query, then adjust the code for form, field names & combo box for yourself

query
SELECT ProductID, ProductName
FROM Products
WHERE ProductID NOT IN (SELECT ProductID FROM OrderDetails WHERE OrderID = Forms!frmOrders!OrderID);

dan in form current:
Private Sub Form_Current()
    Call RequeryComboBox
End Sub

Private Sub cmbProducts_AfterUpdate()
    Call RequeryComboBox
End Sub

Private Sub RequeryComboBox()
    Dim ctrl As Control
    For Each ctrl In Me.Controls
        If ctrl.ControlType = acComboBox Then
            If ctrl.Name = "cmbProducts" Then
                ctrl.RowSource = "SELECT ProductID, ProductName FROM qryAvailableProducts"
                ctrl.Requery
            End If
        End If
    Next ctrl
End Sub
Kevin Robertson  @Reply  
           
2 years ago
I would add a Yes/No field to the table. In my example I named my field IsVisible in my Order table.
Add this field to your Query and set the criteria to True.
I also added a button to show ALL records.
Modify the code to your specific needs.

Example code:

Private Sub HideRecords(ShowRecord As Boolean)

    If ShowRecord Then
        CurrentDb.Execute "UPDATE OrderT SET Isvisible=True"
    Else
        CurrentDb.Execute "UPDATE OrderT SET Isvisible=False WHERE OrderID=" & OrderID
    End If
        
    Me.Recordset.Requery
    
End Sub

Private Sub Form_Current()

    HideRecords False
    
End Sub

Private Sub btnShowAllRecords_Click()

    HideRecords True
    
End Sub

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

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: 4/30/2026 12:52:34 PM. PLT: 1s