Dear krool,
This is in continuation of my last message (in which I have requested your clarification on .colsvisible and .rowsvisible).
And, reg. the
various ComboList values, I am sorry that I am not that very clear in my understanding of them.
So, via the following cases, I am trying to understand them in the right way from you. So, kindly please help.
Case 1)
In your VBFlexGrid demo, in
UserEditingForm, I have the following lines at the end of the Form_Load event.
Code:
Debug.Print VBFlexGrid1.ComboListCount
Debug.Print VBFlexGrid1.ComboListIndex
Debug.Print VBFlexGrid1.ComboList(10) & "Z"
Debug.Print VBFlexGrid1.ColComboItems(10)
The above print '0', '0', 'Z' and 'Arnold|Bob|Charlie|David|Elena|Felix|Greg|Hanna|Ivan|Jacob'
a) Why '0' got printed for .
ComboListCount? Why
.ComboList(10) prints empty string?
b) Even if I make the rows count as 2 for VBFlexGrid1 and select 'Ivan' (instead of the default Arnold) in both the 10th and 11th columns, then also .
ComboListIndex is printed as '0' only. Why?
c) Perhaps .ComboList, .ComboListCount and .ComboListIndex carry meaning only when they are used in specific events like VBFlexGrid1_EnterEdit(), VBFlexGrid1_LeaveEdit(), etc.? If so,
in which all events they carry meaning? Please let me know.
Case 2)
At the end of the VBFlexGrid1_EnterEdit() event, I have the following lines.
Code:
Debug.Print VBFlexGrid1.ComboListCount
Debug.Print VBFlexGrid1.ComboListIndex
'''''Debug.Print VBFlexGrid1.ComboList(10) & "Z"
Debug.Print VBFlexGrid1.ColComboItems(10)
And, when I double click a cell in the 10th column where 'Charlie' is present, what get printed are:
'10', '2' and 'Arnold|Bob|Charlie|David|Elena|Felix|Greg|Hanna|Ivan|Jacob'
I had to comment out the 3rd line above because it caused a
run time error (Invalid procedure call or argument).
a) Why the 3rd line caused an error? Please educate me. Is it that it cannot or should not be used in certain events?
b) Where then should (or where all I can) use that line so that it will show some output?
c)
What actually is .ComboList(10) supposed to show? Is it supposed to show the same output of ColComboItems(10) but without the '|' and all the 10 names displayed one after the other, in 10 lines?
Case 3)
At the end of the VBFlexGrid1_LeaveEdit() event, I have the following lines.
Code:
Debug.Print VBFlexGrid1.ComboListCount
Debug.Print VBFlexGrid1.ComboListIndex
'Debug.Print VBFlexGrid1.ComboList(10) & "A"
Debug.Print VBFlexGrid1.ColComboItems(10)
VBFlexGrid1.ComboListIndex = 9
Debug.Print "yes"; VBFlexGrid1.ComboListIndex
And, when I double click a cell in the 10th column where Charlie is present and select Charlie itself again, what get printed are:
'10', '2', 'Arnold|Bob|Charlie|David|Elena|Felix|Greg|Hanna|Ivan|Jacob' and 'yes 9'
a) I had to keep the 3rd line commented out here also since it caused the same run time error (Invalid procedure call or argument).
b) Though I changed the .ComboListIndex to 9, the selection remained at 'Charlie' only.
c) So, where and how should I use .ComboListIndex
so that I can "programmatically" change/select the ComboList item in any cell in the 10th column (ComboDropDown) without having to manually double click a cell and select a particular item in the list.
Thanks a TON once again for your contribution to the world society.
Kind regards.