PRB: Setting a Default Value in a Client Listbox DTCID: Q194017
|
When you attempt to set a default (selected) value of a Listbox Design-time control (DTC) with the Scripting Platform set to "Client (IE 4.0 DHTML)" and the Row Source set to a Recordset DTC with the Scripting Platform set to "Client (IE 4.0 DHTML)", no default value is set when you use the following code in the Window_onload or Recordset1_ondatasetcomplete events:
Listbox1.selectedIndex = 0;
-or-
Listbox1.selectByText("text");
To set a default value in the Window_onload event you must use the following code:
Recordset1.advise(RS_ONDATASETCOMPLETE, "Listbox1.selectedIndex=0");
-or-
Recordset1.advise(RS_ONDATASETCOMPLETE, "Listbox1.selectByText('text')");
This defers selection of an item until after the Listbox DTC is initialized
by the Recordset DTC.
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
Listbox1.selectedIndex = 0;
Additional query words: kbVisID600 kbDSIASPGrp
Keywords : kbCtrl kbide kbVisID600 kbGrpASP
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 27, 1999