Re: How to determine source of opened form
- From: "Dirk Goldgar" <dg@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Apr 2005 17:09:10 -0400
"Brendan Reynolds" <brenreyn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:OCu7lXpSFHA.3552@xxxxxxxxxxxxxxxxxxxx
> To determine whether a given form is open ...
>
> If CurrentProject.AllForms("NameOfFormHere").IsLoaded Then
> 'it's open
> Else
> 'it's not
> End If
>
> Access does not (so far as I am aware) expose any means to identify
> what form or procedure opened the active form, so you'd need to keep
> track of that yourself in some way, for example by passing the name
> of the calling form in the OpenArgs argument of the OpenForm method
> or by using a global variable.
This is true, but you can, in the opened form's Open event, find out
what form is currently active by interrogating Screen.ActiveForm.Name,
which -- if this form can only be opened from another form -- will be
the "calling" form.
I prefer Brendan's approach of passing the name of the calling form via
OpenArgs, because it is insulated from any unexpected loss of focus by
the calling form.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
.
- References:
- How to determine source of opened form
- From: Mary Fran
- Re: How to determine source of opened form
- From: Brendan Reynolds
- How to determine source of opened form
- Prev by Date: Re: Getting Date Only
- Next by Date: RE: Data Enry Forms
- Previous by thread: Re: How to determine source of opened form
- Next by thread: Re: text box search form
- Index(es):
Relevant Pages
|
Loading