I am very pleased with Dr. Wayne's article on
"Using Alpha Five Version 4's On Key event"
(see copy of the code below)
I have implemented this method of "search" successfully
within my application. In this case the browse simply search for records within the "Parent" record/
Let's suppose if this search is to be done on Browse1,
where Browse1 happend to be a child of a set.
Can someone suggest the neccessary changes for me to accomplishe this similar search function ?
Your assistance is greatly appreciated.
My form name is MASTER
Main database table name is HEADER
The child database/table name is HEADER_DATA
(linked to HEADER)
The code below will search everything in HEADER perfectly
but I would like it to search for records in HEADER_DATA
instead.
Ken Tjia
************ DR WAYNE'S ARTICLE *********************
dim shared tempstr as c
dim shared posn as n
dim shared choice as c
dim up as c
dim repeat as c
table.current().index_primary_put("name")
if this.active()="choice" then
select
case a_user.key.event="down"
if left(a_user.key.value,1)="{" then
' it's a control key or backspace or function key
select
case a_user.key.value="{BACKSPACE}"
if posn>0 then
posn=posn-1
tempstr=iif(posn=0,"",left(tempstr,posn))
a_user.key.handled=.t.
end if
case else
' pass through
a_user.key.handled=.f.
end select
else
posn=posn+1
tempstr=tempstr+a_user.key.value
a_user.key.handled=.t.
end if
case a_user.key.event="up"
up=a_user.key.value
a_user.key.handled=.t.
case a_user.key.event="repeat"
repeat=a_user.key.value
a_user.key.handled=.t.
end select
table.current().fetch_find(tempstr)
browse1.refresh()
choice=tempstr
choice.refresh()
end if
"Using Alpha Five Version 4's On Key event"
(see copy of the code below)
I have implemented this method of "search" successfully
within my application. In this case the browse simply search for records within the "Parent" record/
Let's suppose if this search is to be done on Browse1,
where Browse1 happend to be a child of a set.
Can someone suggest the neccessary changes for me to accomplishe this similar search function ?
Your assistance is greatly appreciated.
My form name is MASTER
Main database table name is HEADER
The child database/table name is HEADER_DATA
(linked to HEADER)
The code below will search everything in HEADER perfectly
but I would like it to search for records in HEADER_DATA
instead.
Ken Tjia
************ DR WAYNE'S ARTICLE *********************
dim shared tempstr as c
dim shared posn as n
dim shared choice as c
dim up as c
dim repeat as c
table.current().index_primary_put("name")
if this.active()="choice" then
select
case a_user.key.event="down"
if left(a_user.key.value,1)="{" then
' it's a control key or backspace or function key
select
case a_user.key.value="{BACKSPACE}"
if posn>0 then
posn=posn-1
tempstr=iif(posn=0,"",left(tempstr,posn))
a_user.key.handled=.t.
end if
case else
' pass through
a_user.key.handled=.f.
end select
else
posn=posn+1
tempstr=tempstr+a_user.key.value
a_user.key.handled=.t.
end if
case a_user.key.event="up"
up=a_user.key.value
a_user.key.handled=.t.
case a_user.key.event="repeat"
repeat=a_user.key.value
a_user.key.handled=.t.
end select
table.current().fetch_find(tempstr)
browse1.refresh()
choice=tempstr
choice.refresh()
end if
Comment