[AccessD] Loading more than one instance of a form

DWUTKA at marlow.com DWUTKA at marlow.com
Mon Jun 26 10:42:54 CDT 2006



-----Original Message-----
From: JWColby [mailto:jwcolby at colbyconsulting.com]
Sent: Monday, June 26, 2006 8:31 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Loading more than one instance of a form


>  But there is no way to get around hard coding 'Form_MyForm' in the SET
line other then of course to generate the code on the fly in a module.

Precisely!!! 


John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman
Sent: Monday, June 26, 2006 8:11 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Loading more than one instance of a form

Michael,

  It's not the tracking that's a problem.  You can easily do something like
this:

Option Compare Database

Public colForms As New Collection
Public mintI As Integer

Public Sub NewFormInstance(frmOld As Form_MyForm)

 Dim frm As Form_MyForm
 
 Set frm = New Form_MyForm
 
 mintI = mintI + 1
 colForms.Add Item:=frm, Key:=frm.Hwnd & ""
 frm.Caption = "My Form " & mintI
 DoCmd.MoveSize (mintI + 1) * 80, (mintI + 1) * 350  frm.Visible = True

End Sub 

  That code has been floating around for years and years.

  It's the SET line that's the problem.  You can't create a new instance of
the form class without specifically in code naming the form.  You could make
the dim for frm generic by doing:

 Dim frm as Form

  But there is no way to get around hard coding 'Form_MyForm' in the SET
line other then of course to generate the code on the fly in a module.

Jim. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael R Mattys
Sent: Sunday, June 25, 2006 9:19 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Loading more than one instance of a form

I don't understand.
To me, there is FindWindow and FindWindowEx

Michael R. Mattys
MapPoint Developer
www.mattysconsulting.com


-- 
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