FancyPrairie
Programmer
I have a textbox on a Page within a TabControl. I want to be able to loop thru the parents until I determine that the parent is the form. How do I know when the parent of the control represents the form?
For example:
How do I know that the last one represents a form and not a control?
For example:
Code:
Dim ctl as control
debug.print ctl.Parent 'displays "Page1" (Name of the Tab Control page)
debug.print ctl.Parent.ControlType '=124 (acPage)
debug.print ctl.Parent.Parent.Name 'displays "tabCtl" (Name of my Tab Control)
debug.print ctl.Parent.Parent.ControlType '=123 (acTabCtl)
debug.print ctl.Parent.Parent.Parent.Name 'displays "Form1" (Name of my form)
debug.print ctl.Parent.Parent.Parent.ControlType 'Error!! ControlType is not a property of a Form