Home  |  About  |   Search   

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

RunCommand Constants

Terms of Use


 

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-2009, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer