FoxProProgrammer
Programmer
I am developing a form with a Tab control. One of the tabs has a combo box. I want to initialize the item selected in the combo box when the user selects that tab. I initialize the selected row in the combo box in the Tab Change event with the following code.
ComboBox.ListIndex = 0
This works fine as long as I click on any tab other than the tab that contains the combo box. For example, if I change the tab and come back to the tab with the combo box it works fine. The first row is selected like I want. However, if I click on the tab that contains the combo box when that tab is already displayed, I get the following error:
Run-time error '7777':
You've used the ListIndex property incorrectly.
The Help isn't enabled on the error dialog window and F1 doesn't run help either. Does anyone know what's causing this? If I have to I can save the last tab pressed and enclose the ListIndex code in an If structure that bypasses the statement if the current tab is the same as the last tab. That just seems convoluted if there's a logical reason why this error occurs.
Thanks!
dz
ComboBox.ListIndex = 0
This works fine as long as I click on any tab other than the tab that contains the combo box. For example, if I change the tab and come back to the tab with the combo box it works fine. The first row is selected like I want. However, if I click on the tab that contains the combo box when that tab is already displayed, I get the following error:
Run-time error '7777':
You've used the ListIndex property incorrectly.
The Help isn't enabled on the error dialog window and F1 doesn't run help either. Does anyone know what's causing this? If I have to I can save the last tab pressed and enclose the ListIndex code in an If structure that bypasses the statement if the current tab is the same as the last tab. That just seems convoluted if there's a logical reason why this error occurs.
Thanks!
dz