Marshall Barton <(E-Mail Removed)> wrote in
news:(E-Mail Removed):
> iccsi wrote:
>
>>I would like to check form open or not, if not then open the form
>>and bring it to front, if it opens then bring it to front.
>>
>>I tried to look myform.open, but does not exist.
>>I just wonder any command to do the task.
>>
>
> I think this kind of thing should do that:
>
> If CurrentProject.AllForms![form name].IsLoaded Then
> DoCmd.SelectObject acForm, "form name"
> Else
> DoCmd.OpenForm "form name"
> End If
>
> Be sure to check VBA Help for all the stuff that you are not
> already familiar with.
Why would you bother to check, given that DoCmd.OpenForm does the
job without any conditional checking?
(also, note that you left out the period between DoCmd and the
command in your sample code -- I've restored it in the quoted code).
--
David W. Fenton
http://www.dfenton.com/
contact via website only
http://www.dfenton.com/DFA/