I posted a thread on this same topic a few day ago. However I thought it would be best to start a new thread as I have observed some different behavor than previously reported and I have more information
I have been using Alpha Five for many years and have not known this problem to ever occur until I started using version 10 (build 2814-3539)
I have a form with an embedded browse. The browse contains records having an empty date field. When I enter dates sometimes the record disappears. This has happend numerous times but not every time I enter a date. The last occurance of this I entered dates for 4 records and only one record was lost. If I look at the table the record count is unchanged because the lost record is replaced by a duplicate record. In this instanace record number 60 was replaced by a copy of record number 93.
I have lots of questions but no answers.
1. Why doesn't this occur every time?
2. Does it depend on some action just before I enter dates or just after or some combination?
3. Is there something different about the records that are lost ? I don't think so but don't really know.
4. I have a number of very similar forms in my database. Why doesn't this occur with the other forms. Maybe it will eventually since it only happens sometimes with the form in question and I haven't had time to check all the other forms.
5. Is the record always replaced by one 33 records away? Don't think so but don't know for sure.
6. How can I prevent this? I guess the obvious answer is to remove version 10 and go back to version 9. Just chalk it up to a bad decision on my part to buy the newest version. On the other hand I am not 100% certain this did not happen with previous versions. I would need to investigate a lot of backup copies to determine this ... not something I have time to do at this moment.
7. This form (as well as several others) has an onkey script. Could that be a problem even though it worked perfectly in preivious versions? A copy of that script follows:
filter= "egh_ds_form ={} .and.( left(status,6)='active' .or. left(status,4)='sust')"\
+" .and. containsi(exemptions,'*security*')=.F. .and. containsi(lname,'*open*')=.f."
tbl=table.current()
query.order="lname+fname+middle_name"
query.filter= filter
query.options=""
IF a_user.key.value = "{enter}" THEN
a_user.key.handled = .T.
IF a_user.key.event = "down" THEN
browse1.activate()
sys_send_keys("{right}{right}{right}{right}")
end if
end if
IF a_user.key.value = "{F1}" THEN
a_user.key.handled = .T.
IF a_user.key.event = "down" THEN
tbl=table.current()
tbl.change_begin()
tbl.EGH_DS_form=var->TBdate
tbl.change_end(.t.)
sys_send_keys("{tab}{home}")
END IF
END IF
dim shared tempstr as c
dim shared posn as n
dim shared choice as c
IF a_user.key.value = "{ESC}" THEN
a_user.key.handled = .T.
IF a_user.key.event = "down" THEN
choice=""
tempstr=""
qry=tbl.query_create()
' browse1.resynch()
choice.activate()
END IF
END IF
IF a_user.key.value = "{F2}" THEN
a_user.key.handled = .T.
IF a_user.key.event = "down" THEN
browse1.activate()
sys_send_keys("{right}{right}{right}")
END IF
END IF
dim up as c
dim repeat as c
'table.current().index_primary_put("lname")
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.resynch()
browse1.scroll_current_row(1)
choice=tempstr
curs_posn=posn+1
topparent.cursor_set(curs_posn)
choice.refresh()
end if
Note: I sometimes enter the date via the <F1> key and sometimes by typing the date
This is nightmare as I am, so far, unable to reproduce the problelm by my actions. It just seems to happen randomly. Certainly there must be some event that causes this loss of records.
I hope someone has some suggestions.
I have been using Alpha Five for many years and have not known this problem to ever occur until I started using version 10 (build 2814-3539)
I have a form with an embedded browse. The browse contains records having an empty date field. When I enter dates sometimes the record disappears. This has happend numerous times but not every time I enter a date. The last occurance of this I entered dates for 4 records and only one record was lost. If I look at the table the record count is unchanged because the lost record is replaced by a duplicate record. In this instanace record number 60 was replaced by a copy of record number 93.
I have lots of questions but no answers.
1. Why doesn't this occur every time?
2. Does it depend on some action just before I enter dates or just after or some combination?
3. Is there something different about the records that are lost ? I don't think so but don't really know.
4. I have a number of very similar forms in my database. Why doesn't this occur with the other forms. Maybe it will eventually since it only happens sometimes with the form in question and I haven't had time to check all the other forms.
5. Is the record always replaced by one 33 records away? Don't think so but don't know for sure.
6. How can I prevent this? I guess the obvious answer is to remove version 10 and go back to version 9. Just chalk it up to a bad decision on my part to buy the newest version. On the other hand I am not 100% certain this did not happen with previous versions. I would need to investigate a lot of backup copies to determine this ... not something I have time to do at this moment.
7. This form (as well as several others) has an onkey script. Could that be a problem even though it worked perfectly in preivious versions? A copy of that script follows:
filter= "egh_ds_form ={} .and.( left(status,6)='active' .or. left(status,4)='sust')"\
+" .and. containsi(exemptions,'*security*')=.F. .and. containsi(lname,'*open*')=.f."
tbl=table.current()
query.order="lname+fname+middle_name"
query.filter= filter
query.options=""
IF a_user.key.value = "{enter}" THEN
a_user.key.handled = .T.
IF a_user.key.event = "down" THEN
browse1.activate()
sys_send_keys("{right}{right}{right}{right}")
end if
end if
IF a_user.key.value = "{F1}" THEN
a_user.key.handled = .T.
IF a_user.key.event = "down" THEN
tbl=table.current()
tbl.change_begin()
tbl.EGH_DS_form=var->TBdate
tbl.change_end(.t.)
sys_send_keys("{tab}{home}")
END IF
END IF
dim shared tempstr as c
dim shared posn as n
dim shared choice as c
IF a_user.key.value = "{ESC}" THEN
a_user.key.handled = .T.
IF a_user.key.event = "down" THEN
choice=""
tempstr=""
qry=tbl.query_create()
' browse1.resynch()
choice.activate()
END IF
END IF
IF a_user.key.value = "{F2}" THEN
a_user.key.handled = .T.
IF a_user.key.event = "down" THEN
browse1.activate()
sys_send_keys("{right}{right}{right}")
END IF
END IF
dim up as c
dim repeat as c
'table.current().index_primary_put("lname")
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.resynch()
browse1.scroll_current_row(1)
choice=tempstr
curs_posn=posn+1
topparent.cursor_set(curs_posn)
choice.refresh()
end if
Note: I sometimes enter the date via the <F1> key and sometimes by typing the date
This is nightmare as I am, so far, unable to reproduce the problelm by my actions. It just seems to happen randomly. Certainly there must be some event that causes this loss of records.
I hope someone has some suggestions.
Comment