ListView Control

Getatme

New member
Local time
Yesterday, 22:39
Joined
Apr 10, 2008
Messages
3
I have a form that contains 8 Listview Controls. Each control is populated by a single table. The tables contains employees names and production numbers based on a particlur product line. Each porduct line is a listview control. For example, ListView Control #1 is sales, #2 credit cards, ... The controls sort each employee by a ranking system that is entered into the table. I have code for the dbl_click event of each control to get the selected employee and highlight that person in the other listviews. This works fine. But once the event is run, i can't use another control on the form except the one i used to double click. Example, I dbl click on the first person in listview control # 1 and i finds that person in the other 7 listviews and highlights them, but when i try to hit a command button and another listview, they seem to be frozen. But when i cdbl click on another persons name in listivew control #1, it will exucte the event and highlight that new person in the other listviews. Any Ideas on why the form becomes frozen execpt for the listview that has focus?
 
Can you show us some code you execute on the dbl click event? Is your command button frozen also?
 
Thank you in advance for helping!!!!

This code is on the form and performs the event for the DBL_Click:

Private Sub lvw1_DblClick()
HighLightEmp (lvw1.SelectedItem)
End Sub

The following code is called once the listview control dbl_click happens.

Function HighLightEmp(empalias)
Dim sAlias As String
Dim ControlArray

Set sform = Forms("frmSelection")
sAlias = empalias

If sform("frmEmpSelect") = 1 Then
ControlArray = Array("1", "2", "3", "4", "5", "6", "13", "14", "16")
Else
ControlArray = Array("7", "8", "9", "10", "11", "12", "13", "15", "16")
End If

For x = 0 To UBound(ControlArray)
Set lvxObj = sform.Controls("lvw" & ControlArray(x)).Object

For i = 1 To lvxObj.ListItems.Count
lvxObj.ListItems.Item(i).Selected = False
Next i

For i = 1 To lvxObj.ListItems.Count
If lvxObj.ListItems.Item(i) = sAlias Then
lvxObj.ListItems.Item(i).Selected = True
lvxObj.SelectedItem.EnsureVisible
Else
End If
Next i
Next x

fSelectAlias (sAlias)
End Function
Function fSelectAlias(sSelectedAlias As String)

Set sform = Forms("frmSelection")

With sform("lstEmp")
For i = 0 To .ListCount - 1
If .Column(0, i) Like sSelectedAlias Then
.Selected(i) = True
End If
Next i
End With

End Function
 

Users who are viewing this thread

Back
Top Bottom