Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Back to Appointments    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Filter Appointments with YN
Kathy Henry 
      
3 years ago
Hello!  I like the combo box to choose which records to see in the appointment form.  I wanted to use this same concept except using a yes/no field to toggle between active and inactive.  I put a y/n control on the form and am using it to reference the y/n state of each record.  I'm not even getting a msgbox returned to me from my code so I guess I'm not referencing it correctly.  I'm confident my record source is good because I'm using it as my recordsource for the form:

SELECT RouteT.*, RouteT.Active FROM RouteT WHERE (((RouteT.Active)=True));

Here is the code:
Private Sub ToggleActive_Click()
    If ToggleActive = True Then
        Me.Recordset = "SELECT RouteT.*, RouteT.Active FROM RouteT WHERE (((RouteT.Active)=False));"
    Else
        Me.Recordset = "SELECT RouteT.*, RouteT.Active FROM RouteT WHERE (((RouteT.Active)=True));"
    End If
End Sub
Kevin Robertson  @Reply  
          
3 years ago
Should be RecordSource, not Recordset.

    If ToggleActive Then
        Me.RecordSource = "SELECT * FROM RouteT WHERE Active=False;"
    Else
        Me.RecordSource = "SELECT * FROM RouteT WHERE Active=True;"
    End If
Kathy Henry OP  @Reply  
      
3 years ago
Thanks Kevin, I tried your suggestion but no luck.  It stumped me because I put a msgbox statement before the code and that didn't even return.  I fixed it but not certain how.  The only thing I really changed was putting the database in a trusted location.  Do you think that may have been the source of my problem?

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

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: 2/12/2026 11:20:37 PM. PLT: 1s