Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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


  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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?

    <pre>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
    </pre>


  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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

    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.

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •