thisform.grid1.recordsource="Select student.学号,studengt.姓名,department.系名称,score.总分 From student join (score On student.学号=score.学号 ) and (department on student.系别号=department.系别号)where allt(department.系名称)=allt(this.value)Into cursor bg "
表格的recordsourcetype选sql,recordsource填
thisform.grid1.recordsource="Select student.学号,studengt.姓名,department.系名称,score.总分 From student join (score On student.学号=score.学号 ) and (department on student.系别号=department.系别号)where allt(department.系名称)=allt(this.value)Into cursor bg "
1、组合框点右键-生成器,选择“手工输入数据”,然后依次输入你需要显示的字段名。2、文本框和表格控件添加进来。
3、在按钮上加上代码:
sele 表名 &&表要先加到数据环境中
c1=alltrim(thisform.combo1.value)
t1=thisform.text1.value &&如果是字符型最好加上alltrim()函数
loca for &c1=t1
if found()
sele * from 表名 where &c1=t1 into cursor "temp"
thisform.grid1.recordsource="temp"
else
messagebox("未找到符合条件的记录!",64,"查询失败")
endif
SELECT 学号 DISTINCT FROM 分数INTO CURSOR temp
select temp
DO WHILE NOT EOF()
THISFORM.combol.ADDITEM(temp.学号) &&THISFORM.combo1.ADDITEM(temp.学号)
SKIP
ENDDO
1和字母l是不一样的
看仔细了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)