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

Drew Wutka DWUTKA at marlow.com
Wed Mar 12 10:39:59 CST 2003


I think we all have moments like that, regardless of our age, or relation to
JC! <VBG>

Drew 

-----Original Message-----
From: Bruce Bruen
To: accessd at databaseadvisors.com
Sent: 3/12/03 7:53 AM
Subject: RE: [AccessD] How do I tell if a form is opened as a subform or
not?

Thanks Drew!

Must have been having on of Colby's senior moments, I've used the same
construct 2^n times and it never occurred to me this time.

Thanks again
Bruce

-----Original Message-----
From: accessd-admin at databaseadvisors.com
[mailto:accessd-admin at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Wednesday, March 12, 2003 12:21 PM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] How do I tell if a form is opened as a subform or
not?


This is from my new MiniCalendar database....still in development...but
the function works fine.

Private Function AmIASubForm() As Boolean
On Error GoTo ErrorHandler
Dim varTemp
varTemp = Me.Parent
AmIASubForm = True
Exit Function
ErrorHandler:
Err.Clear
AmIASubForm = False
End Function

-----Original Message-----
From: Bruce Bruen [mailto:bbruen at bigpond.com]
Sent: Tuesday, March 11, 2003 6:58 PM
To: AccessD
Subject: [AccessD] How do I tell if a form is opened as a subform or
not?


Hi List,

I am trying to use a form that may appear as a subform or on its own. If
it's a subform then I want to maximise it in its parent control space,
if not then it should be sized to fit the form. But how do I tell where
it is being opened?  The following doesn't work:

    On Error Resume Next
    If Not IsNull(Me.Parent.Name) Then
        boolIsSubform = True
        DoCmd.Maximize
    Else
        boolIsSubform = False
    End If
    On Error GoTo 0

Ignore the fact that the docmd works on the parent, I am not worried
about that at the moment, only that I don't know how to test the
"subformedness".

Tia
Bruce

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003
 

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003
 

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list