Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Current and History Listings
Kent Morstain 
    
3 years ago
I am determining how best to populate a dropdown list from tables/queries. From the example below, when Prisoner Bibles are received, they are dated when received, the lesson is graded, by whom, and the new lesson is sent to the prisoner.  Once this occurs, it is regulated to the history boxes and the whole process starts again.

At present, there are 7 different Top Level Studies with second-level studies. Each Second Level has approximately 10 to 15 studies.

I would like to know what lessons should I watch or how best to document the current lessons and how to have the db move the current lessons processed to the history boxes once complete.  My thought would be an Archive Button to achieve this.

A complete history of each prisoner is necessary and should be available at a glance.

Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago

John Davy  @Reply  
         
3 years ago
Hi Kent
If you send me an email address, I will send you a Listbox Demo that show you how to flag an item to move to history, providing you add the appropriate field. Look at it and see if it gives you an idea on an approach to your proble,

[email protected]
John
John Davy  @Reply  
         
3 years ago
Hi Kent
I think you should look at Rick's videos on Many to Many Relationships. That relationship is needed when you have a situation where you have many people (prisoners in your case) on one side and many Lessons in your case)on the other side. In a many to many relationship we need a third table to connect the other 2 tables. Rick's video will show you hos to do it. If you need additional help, let me know.
John
Kent Morstain OP  @Reply  
    
3 years ago
John, thank you for your reply.  I have replied to your email twice now, but I don't know if the problem is on my end or what.   I would love to get a copy of your demo database.  Please email me at [email protected] or let me know where I can snag a copy for download.

Watched Richard's Many to Many video and the extended cut (several times in fact).

- When I look up a Prisoner (student) using their TDCJ number, all is well using the ExistingStudentF
- Leaving the Prisoner (student) blank, I can make changes to the subform StudentLessonF with no errors.

Now the problem..........

If I look up a Prisoner (student) on the ExistingStudentF and try to make changes to the subform StudentLessonF the database complains that I must enter a value in the StudentT.TDCJ or if I select Next Student the database fields blanks like expected in the ExistingStudent form, but the error remains after I try to make changes on the StudentLessonF.

I tried placing a TDCJ from the ExistingStudentF on the StudentLessonF,  but it made no difference.

Private Sub TDCJ_AfterUpdate()
    
    StudentID = Nz(DLookup("StudentID", "StudentT", "TDCJ=""" & TDCJ & """"), 0)
    TDCJ = DLookup("TDCJ", "StudentT", "StudentID=" & StudentID)

End Sub
_____________________

So it looks like I need a way to change the StudentLessonF for each Prisoner (Student).

Any help would be most appreciated.


Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago
Forgot to mention I tried the above query and it gave the results but not sure how to relate them, if that makes sense.
Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago
I am still having difficulty with tying the subform StudentXLessonSubF which contains the history of each prisoner/student with the prisoner I look up by their TDJC number.  The code of the subform is below.  The screenshot for the connection table is included as well.

Option Compare Database
Option Explicit

Private Sub DateCourseReceived_AfterUpdate()
    
    Dim sDateCourseReceived As String
    Dim SQL As String
    
    Rem StudentID = Nz(DLookup("StudentID", "StudentT", "TDCJ=""" & TDCJ & """"), 0)
  
        ' Lesson Date Course Received
            sDateCourseReceived = DateCourseReceived
            
            SQL = "INSERT INTO StudentXCourseT (DateCourseReceived) " & _
            "SELECT """ & sDateCourseReceived & """"
            
            DoCmd.RunSQL SQL
            
        End If
        
End Sub

Private Sub LessonGraded_AfterUpdate()
    
    Dim sLessonGraded As String
    Dim SQL As String
    
   Rem StudentID = Nz(DLookup("StudentID", "StudentT", "TDCJ=""" & TDCJ & """"), 0)
  
        ' Lesson Graded Records
            sLessonGraded = LessonGraded
                      
            SQL = "INSERT INTO StudentXCourseT (LessonGraded) " & _
            "SELECT """ & sLessonGraded & """"
            
            DoCmd.RunSQL SQL
                    
End Sub

Private Sub LessonGrader_AfterUpdate()
    
    Dim sLessonGrader As String
    Dim SQL As String
    
    Rem StudentID = Nz(DLookup("StudentID", "StudentT", "TDCJ=""" & TDCJ & """"), 0)
  
        ' Lesson Grader
            sLessonGrader = LessonGrader
                      
            SQL = "INSERT INTO StudentXCourseT (LessonGrader) " & _
            "SELECT """ & sLessonGrader & """"
            
            DoCmd.RunSQL SQL
                    
End Sub

Private Sub LessonSent_AfterUpdate()
    
    Dim sLessonSent As String
    Dim SQL As String
    
    Rem StudentID = Nz(DLookup("StudentID", "StudentT", "TDCJ=""" & TDCJ & """"), 0)
  
        ' Lesson Sent Records
            sLessonSent = LessonSent
                      
            SQL = "INSERT INTO StudentXCourseT (LessonSent) " & _
            "SELECT """ & sLessonSent & """"
            
            DoCmd.RunSQL SQL

End Sub
Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago
Is there any advice for this last problem I have?  Any help would be most appreciated.

Thanks in advance

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: 8/8/2026 12:39:50 AM. PLT: 1s