Results 1 to 4 of 4
  1. #1
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129

    Set Focus to subfrm on Tabbed Page

    My Main form has outgrown itself so I have set up two tabbed pages.
    Both have two subforms. Depending on 1st tab page mainform control choice I want to set focus to certain subforms.

    Private Sub ContractorFK_LostFocus()
    If Me.ContractorFK = "" Or IsNull(Me.ContractorFK) Then
    MsgBox "Contractor Name is Required"
    Exit Sub
    End If

    If Me.ContractorFK = 5 Then


    'Contractor 5 is AppleFields
    Me.frmSubTransTo.SetFocus
    Exit Sub
    End If
    If Me.ContractorFK = "7" Then
    'Contractor 7 is LeftField
    Me.frmSubDel.SetFocus

    Exit Sub
    End If
    End Sub

    So the red line the subform is on the second tabbed page and does not work(focus just moves to the next control after [ContractorFK] )
    The green line works just fine
    So how is the second tab page referenced 2nd tabbed page Name is TransferForms

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If you solved your issue, do you care to share your solution with others that read this Forum?

  3. #3
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129
    No I'm tooo embarrassed as it was a simple error, the query for some reason, whilst still appearing to be in the properties had actually dropped the fields in query by design and I obviously was not looking hard enough.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks for sharing!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Page Header & Forced Page Break
    By Donnydon in forum Reports
    Replies: 1
    Last Post: 09-08-2011, 08:24 AM
  2. Setting focus on a tabbed form
    By crowegreg in forum Forms
    Replies: 21
    Last Post: 08-27-2011, 09:22 AM
  3. Replies: 3
    Last Post: 08-07-2011, 09:22 PM
  4. Page break on report inserts empty page between
    By Galadrielle in forum Reports
    Replies: 0
    Last Post: 07-07-2010, 04:18 AM
  5. Replies: 0
    Last Post: 02-11-2009, 06:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums