以下是引用片段:
其关键代码实现如下: Public Sub InitList() '显示列表的样式和标题 '将查询到的试题信息显示在列表中 '1 Dim arrName() arrName = Array("试题编号", "科目名称", "题型名称", "题目内容", "题目答案", "题目分数", "录入时间", "科目编号", "题型编号") Dim arrColwidth() arrColwidth = Array(1000, 2000, 2000, 2000, 2000, 2000, ddd.Width - 11300, 0, 0) ddd.Cols = 9 ddd.Rows = 2 Dim i As Long For i = 0 To ddd.Cols - 1 ddd.ColWidth(i) = arrColwidth(i) ddd.TextMatrix(0, i) = arrName(i) ddd.TextMatrix(1, i) = "" Next ddd.Rows = 20 '2 If Me.txtKmmc.Tag = "" And Me.txtTxmc.Tag = "" Then Call UpdateDDD(ddd, ExecSql("SELECT dbo.TK.Tkid, dbo.KM.Kmmc, dbo.TX.Txmc, dbo.TK.Tmnr, dbo.TK.Tmda, " _ & " dbo.TK.Tmfs , dbo.TK.Lrsj, dbo.KM.KmId, dbo.TX.TxId FROM dbo.TK INNER JOIN dbo.TX ON dbo.TK.Txid = dbo.TX.TxId INNER JOIN dbo.KM ON dbo.TK.Kmid = dbo.KM.KmId where TK.Ygid=" & CInt(strRyid))) ElseIf Me.txtKmmc.Tag = "" And Me.txtTxmc.Tag <> "" Then Call UpdateDDD(ddd, ExecSql("SELECT dbo.TK.Tkid, dbo.KM.Kmmc, dbo.TX.Txmc, dbo.TK.Tmnr, dbo.TK.Tmda, " _ & " dbo.TK.Tmfs , dbo.TK.Lrsj, dbo.KM.KmId, dbo.TX.TxId FROM dbo.TK INNER JOIN dbo.TX ON dbo.TK.Txid = dbo.TX.TxId INNER JOIN dbo.KM ON dbo.TK.Kmid = dbo.KM.KmId where TK.Ygid=" & CInt(strRyid) & " and Tk.txid=" & CInt(Me.txtTxmc.Tag))) ElseIf Me.txtKmmc.Tag <> "" And Me.txtTxmc.Tag = "" Then Call UpdateDDD(ddd, ExecSql("SELECT dbo.TK.Tkid, dbo.KM.Kmmc, dbo.TX.Txmc, dbo.TK.Tmnr, dbo.TK.Tmda, " _ & " dbo.TK.Tmfs , dbo.TK.Lrsj, dbo.KM.KmId, dbo.TX.TxId FROM dbo.TK INNER JOIN dbo.TX ON dbo.TK.Txid = dbo.TX.TxId INNER JOIN dbo.KM ON dbo.TK.Kmid = dbo.KM.KmId where TK.Ygid=" & CInt(strRyid) & " and Tk.kmid=" & CInt(Me.txtKmmc.Tag)))
|