Scripting of DXListBoxControl

Thursday, September 28, 2006 by c242 | Discussion: DesktopX

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 ?
c242
Reply #1 Thursday, September 28, 2006 8:54 AM
I am sorry, I meant the ComboBox- not the ListBox Control.
Cyberium
Reply #2 Sunday, October 1, 2006 2:16 PM
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

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01