P
Phlip
Access forms coding:
Ogle this sample code from threads of yore:
Public Sub NewTab()
Dim newpage As Page
Dim ctlTab As Control
Dim frmTab As Form
DoCmd.OpenForm "frmTab", acDesign
Set frmTab = Forms("frmTab")
Set ctlTab = frmTab.Controls("TabControl")
Debug.Print "before pages.count = " & ctlTab.Pages.Count
Set newpage = ctlTab.Pages.Add
Debug.Print "after pages.count = " & ctlTab.Pages.Count
DoCmd.Save acForm, "frmTab"
DoCmd.OpenForm "frmTab", acNormal
Set newpage = Nothing
Set ctlTab = Nothing
Set frmTab = Nothing
End Sub
Notice the programmer did nothing with 'newpage'.
I want to do something with it! How can I push a new control into it?
newpage.Controls.Add does not exist.
Ogle this sample code from threads of yore:
Public Sub NewTab()
Dim newpage As Page
Dim ctlTab As Control
Dim frmTab As Form
DoCmd.OpenForm "frmTab", acDesign
Set frmTab = Forms("frmTab")
Set ctlTab = frmTab.Controls("TabControl")
Debug.Print "before pages.count = " & ctlTab.Pages.Count
Set newpage = ctlTab.Pages.Add
Debug.Print "after pages.count = " & ctlTab.Pages.Count
DoCmd.Save acForm, "frmTab"
DoCmd.OpenForm "frmTab", acNormal
Set newpage = Nothing
Set ctlTab = Nothing
Set frmTab = Nothing
End Sub
Notice the programmer did nothing with 'newpage'.
I want to do something with it! How can I push a new control into it?
newpage.Controls.Add does not exist.