Dear all,
I have an add-on form that contains 30 text edits. I did not creat the from with screen painter but positioned them by marking each item's top and left position in the new sub.
I have named them as 'edBox1', 'edBox2'......, 'edBox30'
At a point I need to assign value to each edit text, I have queried the content from DB into one recordset. However, when I start to assign values to each edit text, the performance became very slow.
my code is as follow
me.form.items.item("edBox1").Specific.String = recordset.field.item(0).value.tostring
.
.
.
.
me.form.items.item("edBox30").Specific.String = recordset.field.item(29).value.tostring
I found that B1 seem to iterate each item on the form in order to find the item I specified.
so I think I should specificy items earler.
Now for each item I dim an object for it at new sub
Dim oedBox1 As SAPbouiCOM.EditText
.
.
Dim oedBox30 As SAPbouiCOM.EditText
and while creating forms, I specificy each item to the matched object
Then I assign values to items by
oedBox1.String = recRetrive.Fields.Item(0).Value.ToString
.
.
oedBox30.String = recRetrive.Fields.Item(29).Value.ToString
However, B1 still iterates to find the item and the performance is still slow, does anyone has a better solution to this issue? please kindly advise.
Thank you
Alan
Edited by: Chih-Peng Chen on Dec 17, 2007 8:42 AM