Thank you Dirk. This helps. P.
"Dirk Goldgar" <dg@NOdataSPAMgnostics.com> wrote in message
news:u6PgD00uDHA.2304@TK2MSFTNGP12.phx.gbl...[color=blue]
> "P" <P@no_spam.com> wrote in message
> news:eS1Ab.9294$aw2.4378426@newssrv26.news.prodigy .com[color=green]
> > Hi,
> >
> > Access 2002. I use DoCmd.OpenForm attached to command buttons to open
> > one form from another form. All forms are open in dialog mode. When a
> > user tries to open a form already opened from a form in dialog mode,
> > nothing happens as expected. I would like to inform the users that
> > the form does not open because it is already opened in the
> > background. What event do you suggest using for this? Thank you. P[/color]
>
> There is no event, but you can check before calling DoCmd.OpenForm. In
> Access 2000 or later, you can do it like this:
>
> Dim strFormToOpen As String
>
> strFormToOpen = "MyForm"
>
> If CurrentProject.AllForms(strFormName).IsLoaded Then
> MsgBox "That form is already open."
> Else
> DoCmd.OpenForm strFormToOpen, WindowMode:=acDialog
> End If
>
> --
> Dirk Goldgar, MS Access MVP
>
www.datagnostics.com
>
> (please reply to the newsgroup)
>
>[/color]