Hi there, I am looking at some VBscript and finding that the AddItemsFromTable method does not seem to be working as I am thinking it should.
I have a table that is referenced by DbfFileName. The value field is called Value and the descriptive field of which I want displayed in the cmb control is Desc.
When a particular strType is selected, a certain table is called. What I am finding is that only the value field values are being displayed in the control and not the Desc field values (descriptive text).
If anyone has seen this behaviour or sees any issues on the formatting please let me know. I have included a code snippet below.
Thanks,
Nick
------------------------------------
select case strType
case "SR", "MR", "HP", "HR", "LP", "EG", "EP"
SetPageEnabled "pgStatus", true
SetPageEnabled "pgCulvert", true
SetPageEnabled "pgCulvert2", true
SetPageEnabled "pgBridge", false
SetPageEnabled "pgBeaver", false
set pg = Layer.Forms("EDITFORM").Pages.Item("pgCulvert")
select case strType
case "SR"
strLabel = "Diameter (in)"
pg.Controls("chkSlope").Enabled = true
pg.Controls("chkFish").Enabled = true
pg.Controls("chkEmbedded").Enabled = true
pg.Controls("chkRRBed").Enabled = false
pg.Controls("chkNoGaps").Enabled = false
pg.Controls("chkBankdist").Enabled = false
'pg2.Controls("chkAppFoot").Enabled = false
DbfFileName = DbfPath & "\streamroad_sr.dbf"
msgbox dbfFileName
Set objCboControl = Layer.Forms("EDITFORM").Pages.Item("pgCulvert").Controls("cmbDiam")
objCboControl.clear
Call ObjCboControl.AddItemsFromTable(DbfFileName, "Value", "Desc")
case "MR"
strLabel = "Diameters (ex: 2/2) (cm)"'ft)"
pg.Controls("chkSlope").Enabled = true
pg.Controls("chkFish").Enabled = true
pg.Controls("chkEmbedded").Enabled = true
pg.Controls("chkRRBed").Enabled = false
pg.Controls("chkNoGaps").Enabled = false
pg.Controls("chkBankdist").Enabled = false
case "HP"
strLabel = "End Area (sq.m)"'sqft)"
pg.Controls("chkSlope").Enabled = false
pg.Controls("chkFish").Enabled = false
pg.Controls("chkEmbedded").Enabled = false
pg.Controls("chkRRBed").Enabled = true
pg.Controls("chkNoGaps").Enabled = true
pg.Controls("chkBankdist").Enabled = true
DbfFileName = DbfPath & "\streamroad_hp.dbf"
Set objCboControl = Layer.Forms("EDITFORM").Pages.Item("pgCulvert").Controls("cmbDiam")
objCboControl.clear
Call ObjCboControl.AddItemsFromTable(DbfFileName, "Value", "Desc")