Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Out of memory" due to referencing DataCombo BoundText

Status
Not open for further replies.

aldovalerio

Programmer
Mar 29, 2001
36
0
0
CH
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:
&quot;If strSaveCountryCode <> dbcCountryName.BoundText Then ...&quot;

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 &quot;Out of memory&quot; 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 &quot;2 - dbcDropdownList&quot; and &quot;0 - dbcDropdownCombo&quot;. 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 &quot;txtCountryCode = dbcCountryName.BoundText&quot; and make the comparison as &quot;If strSaveCountryCode <> txtCountryCode Then ...&quot;. I haven't tested it, but I suspect that any reference to BoundText, after performing the same &quot;click and scroll&quot; events would produce this error.
 
Under what procedure is this statement?
 
The &quot;If strSaveCountryCode <> dbcCountryName.BoundText Then ...&quot; code is in a function called by the cmdExit_Click subroutine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top