Results 1 to 2 of 2
  1. #1
    Join Date
    May 2014
    Posts
    14

    Unanswered: Navigation Form Tab Subforms

    Hello Everyone I hope everyone is staying warm. Can someone help me again on this brain teaser and I know it is something obvious I am missing. I have created a Horizontal Navigation form. That form is named for the sake of this discussion AjaxCo. I have two sub-forms within this navigation form are (Employees) and other named (Clients).

    What I would like to do is as I tab through first tab form (Employees) when I lose focus on field named Spouse. I want to be able to automatically jump to next sub-form within this navigation form which is entitled (Clients) and regain tab focus on first field in (Clients) which is entitled FirstName.

    I have placed the following code in First SubForm (Employees) field Spouse lost focus event

    Private Sub Spouse_LostFocus()
    Me. AjaxCo.SetFocus
    Me. AjaxCo!Clients.SetFocus
    Me. AjaxCo!Clients.Form! FirstName.SetFocus
    End Sub

    However, it is not triggering the desired response and getting errors. Does anyone have any ideas? I hope I explained it well. Once again like always Thanks everyone for their help and expertise I really appreciate it.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    If the code resides in the first subform (Employees) , Me represents the name of this subform, which does not have any control named AjaxCo (which is its parent -i.e. the main form).

    You could try:
    Code:
    Private Sub Spouse_LostFocus()
        
        Me.Parent.Clients.Form.Controls("FirstName").SetFocus
    
    End Sub
    See also: http://access.mvps.org/access/forms/frm0031.htm
    Have a nice day!

Tags for this Thread

Posting Permissions

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