Scripting of DXListBoxControl

As I have to write a small application that reads and writes a MSAccess database, I thought it would be a good idea to use an DesktopX gadget as frontend, which is quite nice to use.

One problem I got upon is the ActiveX ListBoxControls. I get them filled from a table nicely but I can't assign the value of the database field to them.

This is the code I use :
Filling (works):
...
strQuery = "SELECT * FROM ShopCategories1"
Set RS2 = CreateObject("ADODB.Recordset")
RS2.Open strQuery, Connection, 3, 3
RS2.MoveFirst
While Not RS2.EOF
DesktopX.ScriptObject("DXShopCategory1").Control.AddItem(RS2("ShopCategoryA"))
RS2.MoveNext
Wend
...

Try to give a value to the control from the main-table :
...
DesktopX.ScriptObject("DXShopCategory1").Control.Text = RS("ShopCategory1")

This leaves the control text empty, but the field has a value, which I know for sure.

So, is it not possible to assign a value to the control ?
1,633 views 2 replies
Reply #1 Top
I am sorry, I meant the ComboBox- not the ListBox Control.
Reply #2 Top
Ok carl, this was a fun experience for me. I wrote a small web browser using activeX controls inc ComboBox control... I had to make it so values were set for the particular items listed. For this I used the Object.PersistStorage method in script, I suppose the answer would be an If, ElseIf statement depending on the ListIndex of the ComboBox - i.e. in the ComboBox the first item is selected (ListIndex(0)) then TableDisplay (whatever object this is) = Object.PersistStorage("FieldName") ? If thats any help at all