S
scott
I have a tab control and a subform on the 3rd tab. With help from a MVP, I
was able to detect if a user clicked the 3rd tab, as code below shows, and
setfocus to the subform, move to new record. I need the subform to default
to a new record even if a user advances to a different record on main form.
Below code works fine on the tab control if a user clicks the "3rd tab".
However, if user advances to the next record while on the "3rd tab", the
subform looses focus and I don't know how to detect if a user goes to a new
record and is on the "3rd tab".
Any ideas?
Private Sub tab_DataForm_Change()
Dim strErrorMsg As String
Dim strTabCntrlSource As String
Dim strLinkMaster As String
Dim strLinkChild As String
Dim subfrm As Access.SubForm
Select Case Me.tab_DataSubForm.Pages(Me.tab_DataForm).Name
Case "1st"
' nothing
Case "3rd"
Forms![myform]![myform_sub]![myDateField].SetFocus
DoCmd.GoToRecord , , acNewRec
Case Else
Exit Sub
End Select
End Sub
was able to detect if a user clicked the 3rd tab, as code below shows, and
setfocus to the subform, move to new record. I need the subform to default
to a new record even if a user advances to a different record on main form.
Below code works fine on the tab control if a user clicks the "3rd tab".
However, if user advances to the next record while on the "3rd tab", the
subform looses focus and I don't know how to detect if a user goes to a new
record and is on the "3rd tab".
Any ideas?
Private Sub tab_DataForm_Change()
Dim strErrorMsg As String
Dim strTabCntrlSource As String
Dim strLinkMaster As String
Dim strLinkChild As String
Dim subfrm As Access.SubForm
Select Case Me.tab_DataSubForm.Pages(Me.tab_DataForm).Name
Case "1st"
' nothing
Case "3rd"
Forms![myform]![myform_sub]![myDateField].SetFocus
DoCmd.GoToRecord , , acNewRec
Case Else
Exit Sub
End Select
End Sub