I am busy creating a bespoke markbook for a school.
I have a form (Called Frm_SubjectSetup)
On Frm_SubjectSetup is a navigation subform (Default name of NavigationSubform)
Each of the tabs is named 'Term 1', 'Term 2', 'Term 3' and 'Term 4' respectively
And naturally, each tab has its own subform containing data that relates to the term.
On Frm_SubjectSetup, I have a combobox where the row source is
My aim is to have the correct tab activated, based on the selection that the user makes in the combobox.
(Clicking on each tab is showing me the correct information)
In the ComboBox.AfterUpdate event, I have tried the following.
None of the above seem to change the focus to the relevant tab.
Any help appreciated.
I have a form (Called Frm_SubjectSetup)
On Frm_SubjectSetup is a navigation subform (Default name of NavigationSubform)
Each of the tabs is named 'Term 1', 'Term 2', 'Term 3' and 'Term 4' respectively
And naturally, each tab has its own subform containing data that relates to the term.
On Frm_SubjectSetup, I have a combobox where the row source is
Code:
SELECT Q_Res_Hdr.ID, [Subject] & [Yr_Level] AS Subj, Q_Res_Hdr.Subject, Q_Res_Hdr.Yr_Level, Q_Res_Hdr.Term
FROM Q_Res_Hdr
ORDER BY Q_Res_Hdr.Subject, Q_Res_Hdr.Yr_Level, Q_Res_Hdr.Term;
My aim is to have the correct tab activated, based on the selection that the user makes in the combobox.
(Clicking on each tab is showing me the correct information)
In the ComboBox.AfterUpdate event, I have tried the following.
Code:
Dim myTerm as String
myTerm = "Term " & CStr(ActiveControl.Column(4))
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:=myTerm, _
PathToSubformControl:="Frm_SubjectSetup.navigationsubform"
With Forms.Item("Frm_SubjectSetup").NavigationSubform
.SetFocus
!AssesmentDescr.SetFocus
End With
'Control.Frm_SubjectSetup.NavigationSubform!myForm.SetFocus //Throws an error - I know why.
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:=myTerm, _
PathToSubformControl:="Frm_SubjectSetup.navigationsubform", _
WhereCondition:="", _
Page:="", _
DataMode:=acFormEdit
// Just to make sure that it has nothing to do with the myTerm var, I hard coded it follows.
DoCmd.BrowseTo acBrowseToForm, "Term 3", "Frm_SubjectSetup.NavigationSubform"
None of the above seem to change the focus to the relevant tab.
Any help appreciated.