General information
Category:
Forms & Form designer
Hi Brad,
I've found that these combo boxes work best with arrays.
Use your sql statement to populate an intrinsic array like this.ialist,
then when you type something not in the array into the box, re-dim the
array and insert the value with code something like this:
local lctext,lcexact,lnarrlen
lctext=iif(empty(this.value),alltrim(this.text),alltrim(this.value))
lcexact=set("exact")
lnarrlen=0
set exact on
with this
if !empty(lctext)
if ascan(.ialist,lctext)=0
lnarrlen=alen(.ialist)+1
dimension .ialist[lnarrlen]
ains(.ialist,1)
store alltrim(lctext) to .ialist[1]
.numberofelements=lnarrlen+1
endif
* if alltrim(this.text)!=lctext
this.value=lctext
* endif
endif
endwith
set exact &lcexact
return
The combo box will see the new value in its list and display it. Otherwise, it just ignores it.
Luke
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only