Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2012
    Posts
    56

    Unanswered: navigating form subforms (4)

    Hi I have a main form with a table as its recordset. I have four subforms with queries as there recordsets all quering the same table but four different groups of data. they are linked to the main form with child master relationship. This all works well in regards to data entry and saving to the two tables. My problem is navigating from main table record to a previous record. all subform recordsets remain in the position they were left in. I move to a previous record on the main form I want have the focus on the first control and all subforms also on the first records. Present situation the focus is on the previous records position on the subform. In short I want to move to previous record on the main form at the first control and beable to tab through the main form and then each subform in the tab order. ( clear as mud )

    Thanks in advance Bob

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    In the module of the main form and in the module of eacg subform, add an event handler for the Current vent, like this:
    Code:
    Private Sub Form_Current()
    
        Me.<FirstControl>.SetFocus
        
    End Sub
    With <FirstControl> beeing the name of the control that must be the firt to receive the focus when the form (and subforms) move from one record to another (<FirstControl> will probably different for each form).
    Have a nice day!

  3. #3
    Join Date
    Oct 2012
    Posts
    56
    Thanks Sinndho it works great except when I create a new record in the main it wont tab anywhere. but its a good start it works well in all the exsisting records.

    Thanks and if you have any thoughts on the new situation it would be great.

    Bob

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Then only execute the code on existing Records:
    Code:
    If Not Me.NewRecord Then
     Me.<FirstControl>.SetFocus
    End IF


    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Oct 2012
    Posts
    56
    Hi this sovled the one problem Thanks. I thought there was a place to put a formal thank you and I cant find it. So acept this formal thank you.

    Bob

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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