I have a client that wishes to open the same form multiple times, for instance, they may be looking at a clients details and then take a call from another client (So the frmClient wants to be open twice) I know how to do this by coding the form name change into the open command, but when the actual name of the form changes, the sub-forms cannot use the correct ref field as they still look for the original form.
I've tried letting the user open several copies of the database on the one PC, but when 3 or 4 users each have 2 or 3 copies open. The system gets very slow.
Here is an example of form class module, which allows to open multiple instances of another form:
Click on cmdView opens another copy of form frmViewEnrForm, which displays info on user whose ID specified in textbox txtEnrollmentID.
Option Compare Database
' this is a form class module
Public colForms As Collection
Public bytFormsCount As Byte
Private Sub cmdClose_Click()
' On Error Resume Next
Private Sub cmdView_Click()
Dim frmView As Form
For Each frmView In colForms
If frmView.tag = "E_" & Me.txtEnrollmentID Then
Set frmView = New Form_frmViewEnrForm
frmView.tag = "E_" & Me.txtEnrollmentID
' invoke here any code
' to display specific data on the form.
' for example,
' frmView.DisplayData Me.txtEnrollmentID