[AccessD] Loading more than one instance of a form

Jim Dettman jimdettman at earthlink.net
Mon Jun 26 07:11:16 CDT 2006


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

----- Original Message ----- 
From: "JWColby" <jwcolby at colbyconsulting.com>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Sunday, June 25, 2006 9:07 PM
Subject: Re: [AccessD] Loading more than one instance of a form


>I do make my own collection, and I don't need to track hwind once I have a
> handle to the form itself.  It is the method of getting that handle to the
> form that is at issue.
>
> 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 Michael R 
> Mattys
> Sent: Sunday, June 25, 2006 9:04 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Loading more than one instance of a form
>
> I think we've discussed this before ...
> Make your own collection and track hWnd
>
> Michael R. Mattys
> MapPoint Developer
> www.mattysconsulting.com
>
> ----- Original Message -----
> From: "JWColby" <jwcolby at colbyconsulting.com>
> To: "'Access Developers discussion and problem solving'"
> <accessd at databaseadvisors.com>
> Sent: Sunday, June 25, 2006 8:47 PM
> Subject: Re: [AccessD] Loading more than one instance of a form
>
>
> ;-)
>
> Suppose, for the sake of argument, that you run a framework library.  And 
> in
> the library is a form which displays progress bars and text for processes.
> Now suppose that you want to open this form to display a progress report 
> for
> some process.  Now suppose that some other process starts running as well,
> and it needs a progress form...
>
>
> 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 Chris Enright
> Sent: Sunday, June 25, 2006 8:30 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Loading more than one instance of a form
>
> v\:* {behavior:url (#default#vml);}v\:* { BEHAVIOR: url
> (#default#vml)}
> Meanwhile, down on the shop floor, whilst we lesser mortals follow this
> thread with interest....
>
> ...... go on you ask..... elbow in ribs....
>
> I get elected to put my head above the parapet.
>
> In layman's terms LOL why do you want to open two forms at the same time?
>
> And the rest of you chickens stop pushing me!
>
> Chris
>
> -- 
> 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





More information about the AccessD mailing list