PRB: Setting a Default Value in a Client Listbox DTC
Article ID: 194017
Article Last Modified on 3/16/2005
APPLIES TO
- Microsoft Visual InterDev 6.0 Standard Edition
This article was previously published under Q194017
SYMPTOMS
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");
RESOLUTION
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.
STATUS
Microsoft is researching this problem and will post new information here in
the Microsoft Knowledge Base as it becomes available.
Additional query words: kbVisID600 kbDSIASPGrp
Keywords: kbide kbprb kbctrl KB194017