Hi,
I am having problems deleting the tabs of my Tabcontrol in an access form.
I have a button on one form, which is supposed to force the deletion of the tabs in another form. My way of doing it seems to cause a problem as I get an error that the form needs to be in design mode to do this(error 2147).
In the prior form, I call the function..
DeleteAlltabs Form_xyz
The function looks like this:
Private sub delete all tabs(frm as object)
Dim tabctrl as Tabcontrol
Set tabctrl = frm.Controls("MainTab")
If not tabctrl is nothing then
For I = tabctrl.Pages.count-1 to 0 step -1
tabctrl.Pages.Remove (i)
Next i
End if
End sub
Any help is greatly appreciated.
I am having problems deleting the tabs of my Tabcontrol in an access form.
I have a button on one form, which is supposed to force the deletion of the tabs in another form. My way of doing it seems to cause a problem as I get an error that the form needs to be in design mode to do this(error 2147).
In the prior form, I call the function..
DeleteAlltabs Form_xyz
The function looks like this:
Private sub delete all tabs(frm as object)
Dim tabctrl as Tabcontrol
Set tabctrl = frm.Controls("MainTab")
If not tabctrl is nothing then
For I = tabctrl.Pages.count-1 to 0 step -1
tabctrl.Pages.Remove (i)
Next i
End if
End sub
Any help is greatly appreciated.