R
rkc
lyle said:I don't know. Sometime when I consider it either worthwhile to have
two instances of a form open (with the form having a subform), or
likely that it will happen I'll check into it.
That'll be great.
lyle said:I don't know. Sometime when I consider it either worthwhile to have
two instances of a form open (with the form having a subform), or
likely that it will happen I'll check into it.
I wish one of them had a short section on globally accessing
things that don't happen to to pointed to my "Me."
I generally don't use subforms any more as the use of the syntax I
have suggested facilitates using full forms as sub forms ... with
none of the limitations of subforms.
When I use multiple instances of forms it is through code like:
Sometime when I consider it either worthwhile to have
two instances of a form open (with the form having a subform), or
likely that it will happen I'll check into it.
[email protected] wrote innews:[email protected]:
"Me" is a reference to the CLASS MODULE of the object the code is
in.
"Me" is a reference to the CLASS MODULE of the object the code is
in.
Huh? What about a single form with two copies of the same subform?
I can't believe your applications have such poor UI that you don't
use subforms or that you're such a poor programmer that you'd not
re-use a form in more than one location if it were appropriate (as
it very often is).
David said:[email protected] wrote in
"Me" is a reference to the CLASS MODULE of the object the code is
in. If you want to refer to a different object, you have to specify
it completely. Another form will be Form!frmOtherForm in place of
Me. A form that is embedded in the form you're coding in will be
Me!subFormControlName.Form.
That's all you need to know.
lyle said:I don't really expect to convert anyone to my position on this matter,
David, and arguing is tedious. So I'm checking out of this thread now.
lyle said:When I use multiple instances of forms it is through code like:
Dim ADetailForms(0 To 1) As [Form_Faculty Details]
Public Sub OpenSomeFormInstances()
Dim z As Long
For z = 0 To 1
Set ADetailForms(z) = New [Form_Faculty Details]
With ADetailForms(z)
.Visible = True
.Caption = "Look Ma Multiple Distinguishable Instances of
a Form " & z
End With
Next z
End Sub
Public Sub ZapAllThoseFormInstances()
Erase ADetailForms
End Sub
Private Sub Form_Load()
Debug.Print Me Is Me.Module 'False
Debug.Print TypeName(Me), TypeName(Me.Module) 'Form_Issue List,
Module Debug.Print VarPtr(Me), VarPtr(Me.Module) '1297044,1296972
Debug.Print ObjPtr(Me), ObjPtr(Me.Module) '1563856, 55509776
End Sub
TTBOMK VBA will search down the stack, so to speak, for the first
pointer to the subform; thus it will reference the last created
instance of the subform.
I can't think of any case where I have used the same form twice as
a subform (on the same parent form)
so I can't say how I would deal with
that, but I expect it would be smoothly and efficiently, if I used
subforms, that is, but, of course, I don't.
I think I stopped using
subforms five years ago or so; as I roll my own, users do not seem
to notice, except that they like to be able to move and size the
"sub" form.
I'm not sure if you were a regular here in CDMA when I posted in
more than one thread about exposing forms in library mdbs, making
them available for reuse not only within one application, but
within many at the same time.
That must be almost ten years ago.
I really hope you won't bother yourself with my level of
programming expertise. It's been of sufficient quality over the
past twenty-five years that I have not had to seek clients
actively during that time. No need for you to miss your beauty
sleep worrying about that.
I don't really expect to convert anyone to my position on this
matter, David, and arguing is tedious. So I'm checking out of this
thread now.