Are you sure you want to do this? It can be done, but with a large
number of records in a table its going to be very unmanageable with
all those windows open. The way to do it is to add separate instances
of form to a collection. For instance, with a table of companies, to
show each company in a separate instance of a frmCompanies form, you'd
firstly put the following in the Declarations area of a module:
Dim frm As Form
Dim colPopups As New Collection
Then add the a function along these lines to the module:
Function StackCompanyForms()
Const conSQL = "SELECT * FROM Companies Order By Company"
Dim dbs As DAO.Database, rst As DAO.Recordset
Dim strSQL As String
Dim n As Integer
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(conSQL)
Do While Not rst.EOF
n = n + 1
Set frm = New Form_frmCompanies
colPopups.Add frm, frm.hwnd & ""
frm.Caption = "Company " & n
frm.Filter = "CompanyID = " & rst.Fields("CompanyID")
frm.FilterOn = True
frm.Visible = True
DoCmd.MoveSize n * 360, n * 360
rst.MoveNext
Loop
End Function
Calling the MoveSize method 'stacks' the forms form top left to bottom
right, but with more than a small number of records you'd soon run out
of screen space, in which case you'd have to amend the code so it
restarts the 'stack' after a certain number.
To close all instances of the form simultaneously put the following
function in the same module:
Function CloseCompanyForms()
Dim n As Long
For n = 1 To colPopups.Count
DoCmd.Close acForm, "frmCompanies"
Next n
End Function
Ken Sheridan
Stafford, England