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 
Cumulative Lesson Progress
Kent Morstain 
    
3 years ago
I have students who are completing correspondence lessons. Each student's history is tracked for what we sent them, what they returned, who graded it, and when it was graded.

One of the problems is the StudentID is not following the Student that is searched for.  What needs to happen, is that I need to record the above items for each student as the student progresses through the lessons.

I do not find any lessons from Richard that I've been able to adapt.

Please point me in the right direction.

The code for the lesson fields are listed below; screenshots to follow.  
____________________________________________________________________________________________________

Option Compare Database
Option Explicit

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

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

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

Private Sub LessonSent_AfterUpdate()

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

End Sub
Kent Morstain OP  @Reply  
    
3 years ago

Kent Morstain OP  @Reply  
    
3 years ago
Also, get this error when selecting the fields on lesson progress.
Kent Morstain OP  @Reply  
    
3 years ago

Scott Axton  @Reply  
        
3 years ago
Didn't study your post in depth.  But...

Check out the Value From a Form and the Value From Subform videos.

You might need to also make your form Modal so that the user cant move off of the current record while editing a given student.
Kent Morstain OP  @Reply  
    
3 years ago
I have watched the videos and I'll admit I'm becoming very frustrated with how to do this.  I know it can be done, but it is apparently something that I'm not able to do.  I am unable to figure out the syntax on how to tie the subform fields (Date Course Received, Lesson Graded, Lesson Grader, and Lesson Sent) to each Student.

Is there some more guidance available or is this just asking too much?

Thanks in advance,
Kevin Robertson  @Reply  
          
3 years ago
Does your Subform have a StudentID?
Link Master/Child Fields on StudentID.

If this is not right for your setup we will need to see the forms in Design View and your Table structure.
Kent Morstain OP  @Reply  
    
3 years ago
My SubForm did not have StudentID, therefore, I added it, but it made no difference.  I don't know what you are asking about when you're asking, but did I Link Master/Child Fields on StudentID?
Kent Morstain OP  @Reply  
    
3 years ago
Main Form

Option Compare Database

Private Sub AddNewStudentsBtn_Click()
    
    DoCmd.OpenForm "AddNewStudentF"
    DoCmd.Close acForm, "MyStudentF"

End Sub

Private Sub Form_Load()
    
    TDCJ = ""
    LastName = ""
    FirstName = ""
    DOB = ""
    UNIT = ""
    Address = ""
    City = ""
    State = ""
    ZIP = ""
    TDCJ.SetFocus
    
End Sub

Private Sub MainMenuF_Click()

    DoCmd.Close acForm, "MyStudentF"
    DoCmd.OpenForm "MainMenuF", acNormal

End Sub

Private Sub FindStudent_Click()
  
    Dim StudentID As Long
    
    StudentID = Nz(DLookup("StudentID", "StudentT", "TDCJ=""" & TDCJ & """"), 0)
  
    If StudentID > 0 Then
      ' TDJC Number found, Lookup Info
            TDCJ = DLookup("TDCJ", "StudentT", "StudentID=" & StudentID)
            LastName = DLookup("LastName", "StudentT", "StudentID=" & StudentID)
            FirstName = DLookup("FirstName", "StudentT", "StudentID=" & StudentID)
            DOB = DLookup("DOB", "StudentT", "StudentID=" & StudentID)
            UNIT = DLookup("Unit", "StudentT", "StudentID=" & StudentID)
            Address = DLookup("Address", "StudentT", "StudentID=" & StudentID)
            City = DLookup("City", "StudentT", "StudentID=" & StudentID)
            State = DLookup("State", "StudentT", "StudentID=" & StudentID)
            ZIP = DLookup("ZIP", "StudentT", "StudentID=" & StudentID)

Else
    
       ' TDJC Number not found, ask for info
          If (Me.Dirty = True) Then
             Me.Undo
          End If
        DoCmd.OpenForm "AddNewStudentF"
          If (Me.Dirty = True) Then
             Me.Undo
          End If
        DoCmd.Close acForm, "ExistingStudentF"
    
    End If
    
  End Sub
Private Sub DoAnother_Click()
  
    TDCJ = ""
    LastName = ""
    FirstName = ""
    DOB = ""
    UNIT = ""
    Address = ""
    City = ""
    State = ""
    ZIP = ""
    TDCJ.SetFocus
  
End Sub

Private Sub NotesAndOrReasonRemovedBtn_Click()
    
    DoCmd.Close acForm, "MyStudentF"
    DoCmd.OpenForm "ReasonRemovedNotesF", acNormal
    
End Sub

Private Sub StudentListBtn_Click()

    DoCmd.Close acForm, "MyStudentF"
    DoCmd.OpenForm "AllStudentContinousF", acNormal

End Sub


Kent Morstain OP  @Reply  
    
3 years ago
Subform Code

Option Compare Database
Option Explicit

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

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

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

Private Sub LessonSent_AfterUpdate()

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

End Sub

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

Kent Morstain OP  @Reply  
    
3 years ago
I hope this gives you what you are looking for.  I have spent countless hours trying to get this to work.  thanks for any assistance you may offer.
Kent Morstain OP  @Reply  
    
3 years ago
Kevin were you able to look at the table structure and the form design to give me somewhere to go with this?

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/2/2026 7:10:44 AM. PLT: 0s