M
Monty
I have two user forms in Project 2003, each with two list boxes, one showing
all of a set of data, and the other showing a subset. When I click on an
entry in the first list box, code clears and re-populates the second, then
selects an item in the second matching the entry in the first.
In one form, this works perfectly. In the other form (which was created
using the first as a template), this code (and similar code)...:
If Me.lstIssues.ListCount = 1 And Me.lstAllIssues.ListIndex >=
-1 Then
For Ctr = 0 To Me.lstIssues.ListCount - 1
If Me.lstIssues.List(Ctr, 0) =
Me.lstAllIssues.List(Me.lstAllIssues.ListIndex, 2) Then
-> Me.lstIssues =
Me.lstAllIssues.List(Me.lstAllIssues.ListIndex, 2)
lstIssues_AfterUpdate
Exit For
End If
Next
End If
....in the line I have marked with a "->", when
Me.lstAllIssues.List(Me.lstAllIssues.ListIndex, 2) has a value of (say) "3",
that value is supposed to be assigned to Me.lstIssues, which starts off
=Null, but sometimes - but not every time - instead of the value changing to
="3" as it should, it changes to ="", and will not accept any value
assignment, either through code or through the immediate window, until the
code is reset, when it is again a gamble as to whether it will behave
properly.
How can I get this control to behave properly consistently?
all of a set of data, and the other showing a subset. When I click on an
entry in the first list box, code clears and re-populates the second, then
selects an item in the second matching the entry in the first.
In one form, this works perfectly. In the other form (which was created
using the first as a template), this code (and similar code)...:
If Me.lstIssues.ListCount = 1 And Me.lstAllIssues.ListIndex >=
-1 Then
For Ctr = 0 To Me.lstIssues.ListCount - 1
If Me.lstIssues.List(Ctr, 0) =
Me.lstAllIssues.List(Me.lstAllIssues.ListIndex, 2) Then
-> Me.lstIssues =
Me.lstAllIssues.List(Me.lstAllIssues.ListIndex, 2)
lstIssues_AfterUpdate
Exit For
End If
Next
End If
....in the line I have marked with a "->", when
Me.lstAllIssues.List(Me.lstAllIssues.ListIndex, 2) has a value of (say) "3",
that value is supposed to be assigned to Me.lstIssues, which starts off
=Null, but sometimes - but not every time - instead of the value changing to
="3" as it should, it changes to ="", and will not accept any value
assignment, either through code or through the immediate window, until the
code is reset, when it is again a gamble as to whether it will behave
properly.
How can I get this control to behave properly consistently?