• Tab Through SubForms Question? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Tab Through SubForms Question? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Author
    Topic
    #441912

    I have a Form (no tabs) with several fields two SubForms (both level 1

    Viewing 0 reply threads
    Author
    Replies
    • #1062341
      • #1062354

        Thanks for the info, almost there!

        CboArticle is a one field record in the SubForm on the Form

        1. When I Tab to cboArticle if there are already records in the SubForm the SetFocus fires OK as soon as I Tab through the last record, this is what I want.

        2. When I Tab to cboArticle if there are no records in the SubForm the SetFocus does not fire and focus stays in cboArticle

        What do I have to change to Tab through the SubForm if there no records like it works in scenario 1 above?

        Private Sub cboArticle_Exit(Cancel As Integer)
        
        On Error GoTo Err_Handler
        
            Dim rs As Object
            Set rs = Me.Recordset.Clone
            rs.MoveLast
            If StrComp(Me.Bookmark, rs.Bookmark, 0) = 0 Then
                
                Me.Parent.txtSubjectGrade.SetFocus
                DoCmd.GoToControl "subfGrievant"
            
            End If
        
        Exit_Sub:
            Set rs = Nothing
            Exit Sub
        Err_Handler:
            Select Case Err.Number
            Case 3021    ' No Current Record
                Me.Parent.txtSubjectGrade.SetFocus
                DoCmd.GoToControl "subfGrievant"
                Resume Exit_Sub
            Case Else
                MsgBox Err.Number & " " & Err.Description
            End Select
                Resume Exit_Sub
        
        End Sub
        
        • #1062407

          Set a breakpoint on the event procedure (click in the first line and press F9), then single step (F8) through it when it is called to see what happens. It works OK for me when I try it.

          • #1062507

            This is an inherited system that I was trying to make more user friendly and the Exit event was messing something else up so I am abandoning this code, thanks for your help

            John

    Viewing 0 reply threads
    Reply To: Tab Through SubForms Question? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: