[AccessD] How do I tell if a form is opened as a subform or not?

Gustav Brock gustav at cactus.dk
Fri Mar 14 05:29:00 CST 2003


Hi Drew

I see. But don't you open a new instance of the calendar if it is
open as a main form and you open another main form with the calender
as a subform? 

/gustav


> Actually, the code I posted was from my new MiniCalendar, which could be
> used as a subform, or as a stand alone, or both at the same time.

> Drew

> -----Original Message-----
> From: Gustav Brock [mailto:gustav at cactus.dk]
> Sent: Thursday, March 13, 2003 3:41 AM
> To: Drew Wutka
> Subject: Re: [AccessD] How do I tell if a form is opened as a subform or
> not?

>> I know what you are saying about intentionally looking for an error.  It
>> gives me an uneasy feeling too, but there are some things that just
>> absolutely require it.

> Of course, and no problem with that.
> However, I can't imagine why one would do as described in your
> example - I've never designed a form to be used as both a main form
> and a subform and indeed not at the same time - but, well, never say
> never.

> /gustav

>> As far as your code, I'm pretty tired so I could be wrong on this, but I
>> think I could trigger a false positive with your code.  If you opened
>> formA,
>> then opened formB, then set the source object on a subform on FormA to
>> FormB, you will now have FormB as a subform on FormA, but your function
>> will
>> say False, because FormB was the last form to be put into the form's
>> collection AND it is also now a subform.  (Actually, just tried it, and it
>> did say false from the subform)

>> I know, it wouldn't be a common occurrence, but the error method is
>> guaranteed to be correct.




More information about the AccessD mailing list