Home  |   French  |   About  |   Search  | mvps.org  

What's New
Table Of Contents
Credits
Netiquette
10 Commandments 
Bugs
Tables
Queries
Forms
Reports
Modules
APIs
Strings
Date/Time
General
Downloads
Resources
Search
Feedback
mvps.org

In Memoriam

Terms of Use


VB Petition

Forms: Determine name of parent form

Author(s)
Dev Ashish

(Q)     Is there any way to know which form opened the active form on screen?  I would like to use this feature to create generic forms.

(A)    While there's no built in way for this, you can easily use the OpenArgs part of Docmd.OpenForm method to pass form name. For example, from SomeFormA, if you have a button which opens SomeFormB using the command

Docmd.OpenForm "SomeFormB", , , , , ,me.Name

then in SomeFormB, you can place a button which when clicked, can close the previous form without hard-coding it's name.

Docmd.Close acForm, me.OpenArgs


© 1998-2010, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer