[AccessD] Multi-Instance Forms re-visited

John W. Colby jwcolby at colbyconsulting.com
Wed Dec 15 12:51:50 CST 2004


There are many workarounds.  What kind of open args do you need passed?

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia
Sent: Wednesday, December 15, 2004 1:40 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Multi-Instance Forms re-visited


So I have the following code in a public module..

the purpose is to have more than one instance of the form where end users
can start "multiple calls" and then keep starting newer calls.

the following code works really well and in fact I can do what I need with
it, except passing openargs... I figure I can use a workaround unless
someone here knows of a better way?

thanks,

---CODE SNIP------------
Option Compare Database
Option Explicit
'Author:    Allen J Browne, January 2000
'Email:     abrowne at odyssey.apana.org.au

Public clnClient As New Collection  'Instances of frmClient.

Function OpenAClient()
    'Purpose:   Open an independent instance of form frmClient.
    Dim frm As Form
    
    'Open a new instance, show it, and set a caption.
    Set frm = New Form_frmClient
    frm.Visible = True
    frm.Caption = frm.Hwnd & ", opened " & Now()
    
    'Append it to our collection.
    clnClient.Add Item:=frm, Key:=CStr(frm.Hwnd)
    Set frm = Nothing
End Function

Function CloseAllClients()
    'Purpose: Close all instances in the clnClient collection.
    'Note: Leaves the copy opened directly from database window.
    Dim lngKt As Long
    Dim lngI As Long
    
    lngKt = clnClient.Count
    For lngI = 1 To lngKt
        clnClient.Remove 1
    Next
End Function
---END CODE SNIP-----------------

-- 
-Francisco
http://pcthis.blogspot.com | PC news with out the jargon!
-- 
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