Hi I have a form which is called by several other forms via the 'showdialog()' command I'd like it to do different things depending on which form it's called from
so I need to get the name of the parent form. I try with Me.Parent.Name or Me.Owner.Name I always get nothing value.
how can I get the form father that called the showdialog command?
There is no parent. That is only relevant for child controls. If you add a
Buttonto a form, the form is the parent of theButton. Your form, like most, is a top-level window, so it has no parent.There is no owner unless you specify one. The way to do that is to pass the owner when you call
ShowDialog, i.e.The dialogue will then be able to access the calling form via its
Ownerproperty.Note that you shouldn't be interested in the
Nameof the owner but rather its type, e.g.