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
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