计算机毕业设计介绍:
(2)多选题
此模块可以添加、修改和删除多选题内容信息。包括题目内容、答案A、答案B、答案C、答案D、正确答案。
以下是引用片段: Private Sub btnSave_Click() Dim strSelect As String Dim i As Long For i = 0 To 3 If Me.Check1(i).Value = 1 Then strSelect = strSelect + Me.Check1(i).Caption End If Next If idkey > 0 Then '修改多选题 Call Exec_SqL("update MultiProblem set title='" & Me.txtTmnr.Text & "',AnswerA='" & Me.Text1.Text & "',AnswerB ='" & Me.Text2.Text & "',Answerc='" & Me.Text3.Text & "',AnswerD='" & Me.Text4.Text & "',Answer='" & strSelect & "' where id=" & idkey & " ") Else '添加多选题 Call Exec_SqL("insert into MultiProblem values('" & Me.txtTmnr.Text & "','" & Me.Text1.Text & "','" & Me.Text2.Text & "','" & Me.Text3.Text & "','" & Me.Text4.Text & "','" & strSelect & "')") End If Unload Me End Sub Private Sub Form_Load() '显示多选题 Me.btnDel.Enabled = False If idkey > 0 Then Dim tmprs As New ADODB.Recordset Set tmprs = ExecSql("select * from MultiProblem where id=" & idkey & "") With tmprs If .RecordCount > 0 Then Me.txtTmnr.Text = .Fields("Title").Value Me.Text1.Text = .Fields("AnswerA").Value Me.Text2.Text = .Fields("AnswerB").Value Me.Text3.Text = .Fields("AnswerC").Value Me.Text4.Text = .Fields("AnswerD").Value Dim i As Long For i = 0 To 3 If InStr(1, .Fields("Answer").Value, Me.Check1(i).Caption) > 0 Then Me.Check1(i).Value = 1 End If Next Me.btnDel.Enabled = True End If End With End If If boolReadOnly Then Me.btnDel.Enabled = False Me.btnSave.Enabled = False End If End Sub
|
〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
第7页为计算机毕业论文部分......