'Paste into a standard module. Change all references to frmCustomers 'to your form's name. 'Put a button on your form and use its click event to call NewCustomerForm 'like this: 'Private Sub Command31_Click() ' Call NewCustomerForm(Me) ' 'End Sub Option Compare Database Option Explicit ' From Access 2000 Developer's Handbook, Volume I ' by Getz, Litwin, and Gilbert (Sybex) ' Copyright 1999. All rights reserved. Private colForms As New Collection Private mintI As Integer Public Sub NewCustomerForm(frmOld As Form_frmCustomers) Dim frm As Form_frmCustomers Set frm = New Form_frmCustomers mintI = mintI + 1 ' The Key value must be a string, so tack on a ' null string to force the conversion. You'll ' use the hWnd later when you try and ' remove the window from the collection of windows. colForms.Add Item:=frm, Key:=frm.hWnd & "" frm.Caption = "Customers " & mintI DoCmd.MoveSize (mintI + 1) * 80, (mintI + 1) * 350 ' Pass along the filter information. frm.Filter = frmOld.Filter frm.FilterOn = frmOld.FilterOn frm.Visible = True End Sub Public Sub RemoveInstance(frm As Form_frmCustomers) ' Each form calls this code when it closes itself. ' This is also hooked to the main ' form's Close event, so skip over the ' error that occurs when you try to close the ' main form (which doesn't have an entry in the ' collection!) On Error Resume Next colForms.Remove frm.hWnd & "" End Sub Public Sub CloseInstances() Dim frm As Form_frmCustomers ' The user may have close some or all of the ' forms by hand. Skip any errors that ' occur because the collection count ' doesn't match reality. On Error GoTo HandleErrors For Each frm In colForms ' Go to the form, and then close it. ' You can't close it given the name, because ' all the form instances have the same name. frm.SetFocus DoCmd.Close ' You could also use ' colForms.Remove 1 ' to remove the first element ' of the collection, over and over, ' but what happens if you can't close ' the form for some reason (Key violation, ' for example)? Explicitly closing ' the form is safer. Next frm mintI = 0 ExitHere: Exit Sub HandleErrors: Resume ExitHere End Sub Public Sub ListInstances() ' Demonstrate printing all the items in the collection. Dim frm As Form_frmCustomers For Each frm In colForms Debug.Print frm.Caption Next frm End Sub