I have a form with a single subform. I need to run spell check on the main form and all the records in the subform then move to the next record in the main form and repeat the process. I found this code which almost does what I need expect that it doesn't loop through all the records in the main form. What do I need to do to get this to loop through all the records in the main form?

Code:
Private Sub SpellCheck_Click()
  
Dim ctlSpell, sf_ctlSpell As Control
Dim frm As Form
Set frm = Screen.ActiveForm
DoCmd.SetWarnings False
 
For Each ctlSpell In frm.Controls
    If TypeOf ctlSpell Is TextBox Then
        If Len(ctlSpell) > 0 Then

        With ctlSpell
        .SetFocus
        .SelStart = 0
        .SelLength = Len(ctlSpell)
        End With
  
        DoCmd.RunCommand acCmdSpelling
        End If
    End If
    
    If TypeOf ctlSpell Is SubForm Then
        ctlSpell.SetFocus

        For Each sf_ctlSpell In ctlSpell.Form.Controls
  
            If TypeOf sf_ctlSpell Is TextBox Then

                If Len(sf_ctlSpell) > 0 Then
                
                With sf_ctlSpell
                .SetFocus
                .SelStart = 0
                .SelLength = Len(sf_ctlSpell)
                End With
  
                DoCmd.RunCommand acCmdSpelling
                End If
            End If
        Next
    End If
Next

DoCmd.SetWarnings True
End Sub