Auto scroll Scroll to Certain Points on a sub form on button click

stu_c

Registered User.
Local time
Today, 05:58
Joined
Sep 20, 2007
Messages
494
Hi All
I have got a Spell check function to check two fields when a button is clicked prior to creating a report, this works perfectly. The issue I have is when it is spell checking a particular box it wont scroll down show the sub form textbox it is checking and just remains at the top of the page, this would be useful when reading what it is actually checking

Code:
Public Function FUNC_SpellChecker()

Dim ctlSpell As Control
DoCmd.SetWarnings False
    
    Set ctlSpell = [Forms]![FRM_TBLALL_FullHRDetails]![SFRM_TBLALL_StaffDetails]![SSFRM_TBLALL_HRReportDetails].[Form]![BackgroundDetails]
    
    [Forms]![FRM_TBLALL_FullHRDetails].SetFocus
       [Forms]![FRM_TBLALL_FullHRDetails]![SFRM_TBLALL_StaffDetails].SetFocus
    [Forms]![FRM_TBLALL_FullHRDetails]![SFRM_TBLALL_StaffDetails]![SSFRM_TBLALL_HRReportDetails].SetFocus
  
    If TypeOf ctlSpell Is TextBox Then
        If IsNull(Len(ctlSpell)) Or Len(ctlSpell) = 0 Then
            ctlSpell.SetFocus
            Exit Function
        End If
        With ctlSpell
            .SetFocus
            .SelStart = 0
            .SelLength = Len(ctlSpell)
            DoCmd.RunCommand acCmdSpelling
        End With
    End If

   Set ctlSpell = [Forms]![FRM_TBLALL_FullHRDetails]![SFRM_TBLALL_StaffDetails]![SSFRM_TBLALL_HRReportDetails].[Form]![ResolutionDetails]
    
    [Forms]![FRM_TBLALL_FullHRDetails].SetFocus
       [Forms]![FRM_TBLALL_FullHRDetails]![SFRM_TBLALL_StaffDetails].SetFocus
    [Forms]![FRM_TBLALL_FullHRDetails]![SFRM_TBLALL_StaffDetails]![SSFRM_TBLALL_HRReportDetails].SetFocus
    
    If TypeOf ctlSpell Is TextBox Then
        If IsNull(Len(ctlSpell)) Or Len(ctlSpell) = 0 Then
            ctlSpell.SetFocus
            Exit Function
        End If
        With ctlSpell
            .SetFocus
            .SelStart = 0
            .SelLength = Len(ctlSpell)
            DoCmd.RunCommand acCmdSpelling
        End With
    End If
DoCmd.SetWarnings True
MsgBox "Spell Check complete!", vbInformation + vbOKOnly, "Spell Check"
End Function
 

Users who are viewing this thread

Back
Top Bottom