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