aldovalerio
Programmer
Here is an "Out of memory" error message that seemingly has nothing to do with memory. I have a line of code which references a DataCombo's BoundText in an If statement:
"If strSaveCountryCode <> dbcCountryName.BoundText Then ..."
If this code is executed after clicking on the DataCombo and scrolling down the data combo's list, but not clicking on a combo list item (i.e., leaving the original item selected); it will give the "Out of memory" message. Note that it doesn't occur if you simply click on the DataCombo and select a list item (the same one or another) in its drop-down list; only if you scroll down the list and don't click on an item. I've tested this on 3 different forms, and the behaviour is consistent. I thought it might depend on the DataCombo.Style, but it occurs with both "2 - dbcDropdownList" and "0 - dbcDropdownCombo". It also occurs regardless of whether the DataCombo is bound to an Adodc data control through its RowSource property.
My solution was to create an invisible TextBox for the BoundText, populate it using "txtCountryCode = dbcCountryName.BoundText" and make the comparison as "If strSaveCountryCode <> txtCountryCode Then ...". I haven't tested it, but I suspect that any reference to BoundText, after performing the same "click and scroll" events would produce this error.
"If strSaveCountryCode <> dbcCountryName.BoundText Then ..."
If this code is executed after clicking on the DataCombo and scrolling down the data combo's list, but not clicking on a combo list item (i.e., leaving the original item selected); it will give the "Out of memory" message. Note that it doesn't occur if you simply click on the DataCombo and select a list item (the same one or another) in its drop-down list; only if you scroll down the list and don't click on an item. I've tested this on 3 different forms, and the behaviour is consistent. I thought it might depend on the DataCombo.Style, but it occurs with both "2 - dbcDropdownList" and "0 - dbcDropdownCombo". It also occurs regardless of whether the DataCombo is bound to an Adodc data control through its RowSource property.
My solution was to create an invisible TextBox for the BoundText, populate it using "txtCountryCode = dbcCountryName.BoundText" and make the comparison as "If strSaveCountryCode <> txtCountryCode Then ...". I haven't tested it, but I suspect that any reference to BoundText, after performing the same "click and scroll" events would produce this error.