Steps:
1) Hide ALL subforms.
2) Then make one subform visible
3) Set the focus to the subform
4) THEN, set the focus to the control
In your mock up this code works: (Select Case is much cleaner code)
Code:
Private Sub AlsoHere_Click()
Me!frmSubBreakdownTransport.Visible = False
Me!frmSubBreakdownGovernment.Visible = False
Select Case Me!AlsoHere
Case "Transport"
Me.frmSubBreakdownTransport.Visible = True
Me.frmSubBreakdownTransport.SetFocus
Me.frmSubBreakdownTransport.Form!text36.SetFocus
'Me.Note.SelText
Case "Government"
Me!frmSubBreakdownGovernment.Visible = True
Me!frmSubBreakdownGovernment.SetFocus
Me!frmSubBreakdownGovernment.Form!text36.SetFocus
End Select
End Sub
Here is the code from Post #9. (You probably could replace "Forms![frmTransactions]! " with "Me. ")
Code:
Private Sub Text194_Enter()
'first hide all sub forms
Forms![frmTransactions]![frmBreakdownMisc].Visible = False
Forms![frmTransactions]![frmBreakdownFinance].Visible = False
Forms![frmTransactions]![frmBreakdownTransport].Visible = False
Forms![frmTransactions]![frmBreakdownHome].Visible = False
Forms![frmTransactions]![frmBreakdownGovernment].Visible = False
Forms![frmTransactions]![frmBreakdownGrocery].Visible = False
Forms![frmTransactions]![frmBreakdownUtilities].Visible = False
Forms![frmTransactions]![frmBreakdownDining].Visible = False
'now make one visible
Select Case Me!TranCat
Case "Misc"
Forms![frmTransactions]![frmBreakdownMisc].Visible = True
Forms![frmTransactions]![frmBreakdownMisc].SetFocus
Forms![frmTransactions]![frmBreakdownMisc].Form![trbRate].SetFocus
Case "Finance"
Forms![frmTransactions]![frmBreakdownFinance].Visible = True
Forms![frmTransactions]![frmBreakdownFinance].SetFocus
Forms![frmTransactions]![frmBreakdownFinance].Form![trbRate].SetFocus
Case "Transport"
Forms![frmTransactions]![frmBreakdownTransport].Visible = True
Forms![frmTransactions]![frmBreakdownTransport].SetFocus
Forms![frmTransactions]![frmBreakdownTransport].Form![trbRate].SetFocus
Case "Home"
Forms![frmTransactions]![frmBreakdownHome].Visible = True
Forms![frmTransactions]![frmBreakdownHome].SetFocus
Forms![frmTransactions]![frmBreakdownHome].Form![trbRate].SetFocus
Case "Goverment"
Forms![frmTransactions]![frmBreakdownGovernment].Visible = True
Forms![frmTransactions]![frmBreakdownGovernment].SetFocus
Forms![frmTransactions]![frmBreakdownGovernment].Form![trbRate].SetFocus
Case "Grocery"
Forms![frmTransactions]![frmBreakdownGrocery].Visible = True
Forms![frmTransactions]![frmBreakdownGrocery].SetFocus
Forms![frmTransactions]![frmBreakdownGrocery].Form![trbRate].SetFocus
Case "Utilities"
Forms![frmTransactions]![frmBreakdownUtilities].Visible = True
Forms![frmTransactions]![frmBreakdownUtilities].SetFocus
Forms![frmTransactions]![frmBreakdownUtilities].Form![trbRate].SetFocus
Case "Dining"
Forms![frmTransactions]![frmBreakdownDining].Visible = True
Forms![frmTransactions]![frmBreakdownDining].SetFocus
Forms![frmTransactions]![frmBreakdownDining].Form![trbRate].SetFocus
End Select
End Sub