unknown
2008-10-30 21:55:27 UTC
On Sat, 1 Nov 2008 15:40:13 -0400 Ivan Benttini
Sender: "Ivan Benttini" <***@nc.rr.com>
wrote the following in:
Newsgroup: dbase.programming
Entryfield1? If yes, try the code below my signature; if no, maybe you can use some of the code
anyway :-)
Ivar B. Jessen
//-----
** END HEADER -- do not remove this line
//
// Generated on 30-10-2008
//
parameter bModal
local f
f = new IvanForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class IvanForm of FORM
with (this)
onOpen = class::FORM_ONOPEN
height = 8.3182
left = 45.4286
top = 7.0455
width = 23.0
text = ""
endwith
this.IVANAB1 = new QUERY()
this.IVANAB1.parent = this
with (this.IVANAB1)
left = 3.0
top = 0.5
sql = 'select City || "-->" || State CityState from "IVANAB.DBF" where upper(City) =
upper(:cName)'
params["cName"] = ""
active = true
endwith
this.LISTBOX1 = new LISTBOX(this)
with (this.LISTBOX1)
height = 5.0
left = 1.0
top = 0.5
width = 21.0
id = 101
sorted = true
endwith
this.ENTRYFIELD1 = new ENTRYFIELD(this)
with (this.ENTRYFIELD1)
onChange = class::ENTRYFIELD1_ONCHANGE
height = 1.0
left = 1.0
top = 7.0
width = 19.0
value = ""
endwith
this.rowset = this.ivanab1.rowset
function ENTRYFIELD1_onChange
class::form_onOpen()
return
function form_onOpen
form.IVANAB1.params["cName"] = iif(empty(form.entryfield1.value), "", form.entryfield1.value)
form.IVANAB1.requery()
aNames = new array()
r = form.IVANAB1.rowset
r.first()
do while not r.endofset
aNames.add(r.fields["CityState"].value)
r.next()
enddo
form.Listbox1.datasource = "Array aNames"
return
endclass
//-----
Sender: "Ivan Benttini" <***@nc.rr.com>
wrote the following in:
Newsgroup: dbase.programming
To anyone willing and with the time to help me.
My goal with the code below is to LOAD in the array(aNames) all the cities
from the table in use that has the same name.(Not all rowsets as it do now,
regard of the city name as you can see with my code).
Do you mean that the listbox should display all the cities with the same name as the one typed intoMy goal with the code below is to LOAD in the array(aNames) all the cities
from the table in use that has the same name.(Not all rowsets as it do now,
regard of the city name as you can see with my code).
Entryfield1? If yes, try the code below my signature; if no, maybe you can use some of the code
anyway :-)
Ivar B. Jessen
//-----
** END HEADER -- do not remove this line
//
// Generated on 30-10-2008
//
parameter bModal
local f
f = new IvanForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class IvanForm of FORM
with (this)
onOpen = class::FORM_ONOPEN
height = 8.3182
left = 45.4286
top = 7.0455
width = 23.0
text = ""
endwith
this.IVANAB1 = new QUERY()
this.IVANAB1.parent = this
with (this.IVANAB1)
left = 3.0
top = 0.5
sql = 'select City || "-->" || State CityState from "IVANAB.DBF" where upper(City) =
upper(:cName)'
params["cName"] = ""
active = true
endwith
this.LISTBOX1 = new LISTBOX(this)
with (this.LISTBOX1)
height = 5.0
left = 1.0
top = 0.5
width = 21.0
id = 101
sorted = true
endwith
this.ENTRYFIELD1 = new ENTRYFIELD(this)
with (this.ENTRYFIELD1)
onChange = class::ENTRYFIELD1_ONCHANGE
height = 1.0
left = 1.0
top = 7.0
width = 19.0
value = ""
endwith
this.rowset = this.ivanab1.rowset
function ENTRYFIELD1_onChange
class::form_onOpen()
return
function form_onOpen
form.IVANAB1.params["cName"] = iif(empty(form.entryfield1.value), "", form.entryfield1.value)
form.IVANAB1.requery()
aNames = new array()
r = form.IVANAB1.rowset
r.first()
do while not r.endofset
aNames.add(r.fields["CityState"].value)
r.next()
enddo
form.Listbox1.datasource = "Array aNames"
return
endclass
//-----