Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Instances of Forms

Status
Not open for further replies.

CID8

Programmer
Nov 22, 2001
25
ES
Hi there, I can't believe this hasn't been discussed before but I can't find the answer in the forums - so anyway heres my problem;

I've got 1 form which has a combo box of employees, when you choose an employee the app creates an instance of separate form, makes it visible, adds it to a forms collection and creates a node in a TreeView control on the search form. This works perfectly well for opening new instances, however I'd also like to be able to select any of nodes from the TreeView and make the existing instance of the form appear upper most in the window. I've used the following code in a different VB application without any problems, but I can't seem to get Access2000 do work.

Code:

Private Sub ocxEmpColl_NodeClick(ByVal Node As Object)

Dim i As Integer

'---Sets choice to active form
For i = 1 To colEmpForms.Count
If Node = colEmpForms.Item(i).Caption Then
colEmpForms.Item(i).ZOrder 0
Exit Sub
End If
Next i

End Sub

Any suggestions would be much appreciated, thanks
Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top