I need to open multi istance form.
1) i have a table (SQL) "ActiveForm" which contains various fields including a field called "FormName" (Varchar (30)).
2) in the access form called "Menu" i place a treeview control and when i "click" in the node, i read the table rsProcedure="SELECT .* FROM ActiveForm WHERE Active=true";
3) Dim Istanzaform As Integer
Dim dbs As Object
Dim myFrm As AccessObject
rsProcedure.MoveFirst
rsProcedure.Find "DescrizioneForm = '" & Node.Text & "'", , adSearchForward
If Not IsNull(rsProcedure("NomeForm")) Then
Set dbs = Application.CurrentProject
For Each myFrm In dbs.AllForms
Debug.Print myFrm.Name
If myFrm.Name = rsProcedure("NomeForm") Then
' Istanzaform = GetNewIstance(myFrm.Name) 'Return a free istance number (0 to 4)
If Istanzaform > 4 Then Exit Sub 'too many istance opened
Set NewIstance(Istanzaform) = new myfrm 'not work!
NewIstance(Istanzaform).Tag = Istanzaform
NewIstance(Istanzaform).Visible = True
End If
Next myFrm
End If
what wrong?
Many thanks.