*text1的Valid事件:
SELECT 1
Ctxt1=ALLTRIM(thisform.text1.value)
P=LEN(ALLTRIM(thisform.text1.value))
for I=1 to P step 2
Ctxt2=substr(Ctxt1,I,I+1)
DELETE ALL FOR Ctxt2$字段名1 &&此字段是你表中要查询的字段名。
endfor
select 2
use
select 1
copy to temp for DELETED()
RECALL all
SELECT 2
USE temp
RECALL all
IF RECCOUNT()>0
thisform.command2.enabled=.t. &&command为“下一个”按钮
GO TOP
thisform.text2.value=字段名1
ELSE
thisform.command2.enabled=.f.
thisform.text2.Value=""
ENDIF
thisform.Refresh
*"下一个"按钮的Click事件:
SELECT 2
IF NOT EOF()
SKIP
thisform.text2.value=字段名1
ELSE
GO BOTTOM
thisform.text2.value=字段名1
ENDIF
thisform.Refresh
******************************************
即在
copy to temp for DELETED()
之前加
select 2
use
select 1
*text1的Valid事件:
SELECT 1
Ctxt1=ALLTRIM(thisform.text1.value)
P=LEN(ALLTRIM(thisform.text1.value))
for I=1 to P step 2
Ctxt2=substr(ctxt,I,I+1)
DELETE ALL FOR Ctxt2$字段名1 &&此字段是你表中要查询的字段名。
endfor
copy to temp for DELETED()
RECALL all
SELECT 2
USE temp
RECALL all
IF RECCOUNT()>0
thisform.command2.enabled=.t. &&command为“下一个”按钮
GO TOP
thisform.text2.value=字段名1
ELSE
thisform.command2.enabled=.f.
thisform.text2.Value=""
ENDIF
thisform.Refresh
*"下一个"按钮的Click事件:
SELECT 2
IF NOT EOF()
SKIP
thisform.text2.value=字段名1
ELSE
GO BOTTOM
thisform.text2.value=字段名1
ENDIF
thisform.Refresh