表单中只有文本框(Text1)和表格(Grid1)两个控件。
在Text1.InterActiveChange里的代码:
If Empty(This.Value)
ThisForm.Grid1.Visible=.F.
Else
Select * From Temp Where 姓名=Alltrim(This.Value) Into Cursor Tmp
ThisForm.Grid1.ColumnCount=-1
ThisForm.Grid1.RecordSourceType=1
ThisForm.Grid1.RecordSource='tmp'
ThisForm.Grid1.Visible=.T.
EndIf
ThisForm.Refresh