Access | data | dropdown | dropdown
The dropdown box lists the data, and then it can be entered by the user, how do you do this?
ComboBox with Edit function
<HTML>
<HEAD>
<PUBLIC>
<component tagname= "COMBOBOX" >
<property name= "Text" get= "Get_text" put= "Put_text" >
<property name= "Width" get= "Get_width" put= "Put_width" >
<method name= "SetFocus" internalname= "Htcfocus" >
<method name= "Additems" internalname= "Htcadditems" >
<event name= "Onyycenter" id= "Identer" >
<event name= "Onyycchoose" id= "Idchoose" >
<attach event= "Oncontentready" onevent= "Htcinit ()" >
</COMPONENT>
</PUBLIC>
<script language= "JavaScript" >
function Htcinit ()
{
Defaults.viewlink=document;
Defaults.viewinheritstyle=false;
Body_init ();
}
function Htcadditems (items)
{
var I,len;
Len=pcombo.options.length;
for (i=0;i<len;i++)
{pcombo.remove (0);}
for (i=0;i<items.length;i++)
{
var o;
if ((typeof items[i]) = = ' String ')
{
if (! Hasthevalue (Items,i))
{
O=document.createelement (' OPTION ');
O.text=items[i];
Pcombo.add (o);
}
}
}
}
function Htcfocus ()
{
Ptext.focus ();
}
function Get_text ()
{
return ptext.value;
}
function Put_text (Value)
{
Ptext.value=value;
}
function Get_width ()
{
return pCombo.style.width;
}
function Put_width (Value)
{
Pcombo.style.width=value;
}
</SCRIPT>
<script language= "JavaScript" >
function Body_init ()
{
var iright=pcombo.clientwidth;
var ibottom=pcombo.clientheight;
var ileft= (pcombo.clientwidth-18);
pcombo.style.clip= ' rect (0, ' +iright+ ', ' +ibottom+ ', ' +ileft+ ') ';
Ptext.style.width= (Pcombo.clientwidth);
Ptext.style.height= (Pcombo.clientheight);
Ptext.style.top=0;
ptext.style.left=0;
}
function Combo_select ()
{
Ptext.value=pcombo.options[pcombo.selectedindex].text;
}
function Text_chkkey ()
{
if (event.keycode==13)
{
Identer.fire ();
}
}
function Hasthevalue (sitems,i)
{
VAR II;
for (ii=0;ii<i;ii++)
{
if (Sitems[ii]==sitems[i])
return true;
}
return false;
}
</SCRIPT>
</HEAD>
<BODY>
<select style= "position:absolute;left:0;top:0;" Name= "Pcombo" >
</SELECT>
<input style= "position:absolute;left:0;top:0;z-index:4000" onkeypress= "Text_chkkey ()" TYPE= "Text" NAME= "PText" >
</BODY>
</HTML>