[此贴子已经被作者于2006-10-4 17:00:36编辑过]
数据环境 xsjbqkb.dbf
close all
xm=thisform.text1.Value
use d:\vf\xsjbqkb.dbf
IF .not. EMPTY(xm)
locat for alltrim(姓名)=alltrim(thisform.text1.value)
**do while not eof()
**continu
**enddo
if not found( )
=messagebox("无相关记录","系统提示")
else
thisform.grid1.refresh
thisform.grid1.recordsource="select * from d:\vf\xsjbqkb where alltrim(姓名)=alltrim(thisform.text1.value)"
endif
else
=MESSAGEBOX("请输入姓名!!!!!",0+48,"系统提示")
ENDIF
RETURN
THISFORM.REFRESH
建议
(1)在表单的初始化部分(THISFORM.INIT)打开文件(use d:\vf\xsjbqkb.dbf)并将其绑定在表格(GRID1)中
close all
use d:\vf\xsjbqkb.dbf
THISFORM.GRID1.RECORDSOURCETYPE=1
THISFORM.GRID1.COLUMNCOUNT=-1
THISFORM.GRID1.RECORDSOURCE="xsjbqkb"
PUBLIC XM
(2)在查询命令按钮的CLICK过程里写上如下的代码
xm=alltrim(thisform.text1.value)
IF EMPTY(xm)
SET FILTER TO
ELSE
SET FILTER TO XM$姓名
GO TOP
ENDIF
THISFORM.REFRESH