我建立了一个表单如下图
现在需要实现的就是编写查询的代码,在查询的CLICK事件中编写:
temp=MESSAGEBOX("确定输入无误吗?",4+32+256,"提示!")
IF temp=6
SELECT * from jwxx!stu where stu.学号=ALLTRIM(thisform.text1.value);
order by stu.学号 into cursor tempcursor
thisform.grid1.RecordSource=tempcursor
ENDIF
在查询的INIT事件中编写
PUBLIC tempcursor
最后运行表单时,首页直接显示全部stu表的全部数据,输入学号后点查询,表格数据就全空了,怎么实现刚开始看见的就是一张空的表,然后查询什么就显示什么,希望大神能帮我解答一下!谢谢!