如果提交的值同时有xh和xm,会重复执行。
应该:
With wb.AddTable("","Table1")
If e.PostValues.ContainsKey("xh") Then
.CreateFromDataTable(DataTables("分段统计"),True,"学校= '" & e.PostValues("xh") & "'","","学校","科目","最高分","最低分","平均分")
With wb.AddButtonGroup("","btg1",True)
With .Add("fh", "返回", "spjc.htm")
.Attribute = ""
End With
End With
ElseIf e.PostValues.ContainsKey("xm") Then
.CreateFromDataTable(DataTables("检测"),True,"姓名= '" & e.PostValues("xm") & "'","","姓名","学校","语文","数学","英语","总分")
With wb.AddButtonGroup("","btg1",True)
.Add("fh", "返回", "spjc.htm").Attribute = ""
End With
End If
e.WriteString(wb.Build)
End With
具体可以自己调试一下,看看执行到哪里提示错误。