Search code examples
ms-accessformsvbasubform

MS Access 2003/2007 - Subform as control panel, closing parent form with global like reference?


I am sorry if the title is wrong, but I think that is what I mean to ask.

So I have a subform created that I would like to use, sort of like a control panel, that allows user to select a range of different forms. So the same subform ends up in a lot of different parent forms. I would like to use simple

docmd.close acform

but i am looking for a way to reference the parent form like "active form" or something like that so I can close whatever form is open before opening the intended form. that way i can use the same sub form (control panel) in a lot of forms and it works globally??

thanks justin


Solution

  • From within the subform you can get the name of its parent form with:

    Me.Parent.Name