⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form9.frm

📁 用vb编写的网上试题库对你学习VB很有帮助!
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Height          =   495
         Index           =   0
         Left            =   360
         TabIndex        =   21
         Top             =   1680
         Width           =   975
      End
      Begin VB.Label Label13 
         Caption         =   "试卷名称"
         Height          =   495
         Index           =   0
         Left            =   480
         TabIndex        =   19
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label12 
         Caption         =   "通过率"
         Height          =   495
         Left            =   -74400
         TabIndex        =   17
         Top             =   3480
         Width           =   615
      End
      Begin VB.Label Label10 
         Caption         =   "级英语试卷"
         Height          =   495
         Left            =   -70680
         TabIndex        =   16
         Top             =   2640
         Width           =   1215
      End
      Begin VB.Label Label9 
         Caption         =   "月 "
         Height          =   495
         Left            =   -71640
         TabIndex        =   14
         Top             =   2640
         Width           =   615
      End
      Begin VB.Label Label8 
         Caption         =   "年"
         Height          =   495
         Left            =   -72720
         TabIndex        =   12
         Top             =   2640
         Width           =   495
      End
      Begin VB.Label Label7 
         Caption         =   "试卷名"
         Height          =   375
         Left            =   -74640
         TabIndex        =   10
         Top             =   2640
         Width           =   735
      End
      Begin VB.Label Label6 
         Caption         =   ".HTML"
         Height          =   495
         Left            =   -68400
         TabIndex        =   9
         Top             =   1560
         Width           =   615
      End
      Begin VB.Label Label5 
         Caption         =   ".HTML"
         Height          =   495
         Left            =   -70800
         TabIndex        =   8
         Top             =   1560
         Width           =   855
      End
      Begin VB.Label Label4 
         Caption         =   ".MP3"
         Height          =   495
         Left            =   -73200
         TabIndex        =   7
         Top             =   1560
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "答案"
         Height          =   495
         Left            =   -69480
         TabIndex        =   5
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "试题"
         Height          =   495
         Left            =   -71880
         TabIndex        =   4
         Top             =   840
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "听力"
         Height          =   495
         Left            =   -74280
         TabIndex        =   1
         Top             =   840
         Width           =   1215
      End
   End
End
Attribute VB_Name = "试题的增删"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click(index As Integer)
Select Case index
Case 0
Data1.Recordset.MoveFirst
Case 1
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
Case 2
Data1.Recordset.MoveFirst
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
End If
Case 3
Data1.Recordset.MoveLast
End Select
Call dateview1
End Sub

Private Sub Command2_Click()
Data1.Recordset.Delete
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
Data1.Refresh
Call dateview1
End Sub

Private Sub Command3_Click(index As Integer)
Select Case index
Case 0
Data1.Recordset.MoveFirst
Case 1
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
Case 2
Data1.Recordset.MoveFirst
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
End If
Case 3
Data1.Recordset.MoveLast
End Select
Call dateview2
End Sub

Private Sub Command4_Click()
Data1.Recordset.Edit
Data1.Recordset.Fields("tinglilujing") = Text20.Text
Data1.Recordset.Fields("shijuanlujing") = Text18.Text
Data1.Recordset.Fields("daanlujing") = Text19.Text
Data1.Recordset.Fields("shijuanmingcheng") = Text15.Text
Data1.Recordset.Fields("shijuantongguolv") = Text17.Text
Data1.Recordset.Update
inta = MsgBox("保存成功", vbYesNo, "温馨提示")
Data1.Refresh
End Sub

Private Sub Command5_Click(index As Integer)
Select Case index
Case 0
Data1.Recordset.MoveFirst
Case 1
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
Case 2
Data1.Recordset.MoveFirst
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
End If
Case 3
Data1.Recordset.MoveLast
End Select
Call dateview3
End Sub

Private Sub Command6_Click()
Call dateview1
Command2.Enabled = True
End Sub

Private Sub Command7_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text8.Text = "" Or Text27.Text = "" Then
inta = MsgBox("请输入完整信息", vbYesNo, "温馨提示")
Else
Data1.Recordset.FindFirst ("shijuanmingcheng='" & Text4.Text & Label8.Caption & Text5.Text & Label9.Caption & Text6.Text & Label10.Caption & Text27.Text & "'")
If Data1.Recordset.NoMatch Then
Data1.Recordset.AddNew
Data1.Recordset.Fields("tinglilujing") = Text1.Text & Label4.Caption
Data1.Recordset.Fields("shijuanlujing") = Text2.Text & Label5.Caption
Data1.Recordset.Fields("daanlujing") = Text3.Text & Label6.Caption
Data1.Recordset.Fields("shijuanmingcheng") = Text4.Text & Label8.Caption & Text5.Text & Label9.Caption & Text6.Text & Label10.Caption & Text27.Text
Data1.Recordset.Fields("shijuantongguolv") = Text8.Text
Data1.Recordset.Update
inta = MsgBox("增加成功", vbYesNo, "温馨提示")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text8.Text = ""
Text27.Text = ""
Else
inta = MsgBox("该试卷已存在", vbYesNo, "提示")
Text1.SetFocus
End If
End If
Data1.Refresh
End Sub

Private Sub Command8_Click()
Call dateview2
Command4.Enabled = True
End Sub

Private Sub Command9_Click()
Call dateview3
End Sub

Private Sub Form_Load()
On Error Resume Next
Data1.DatabaseName = "试题库.mdb"
Data1.RecordSource = "试题听力答案"
Data1.Refresh
If Data1.Recordset.BOF And Data1.Recordset.EOF Then
inta = MsgBox("请增加试卷", vbYesNo, "提示")
End If
Text16.Enabled = False
Command2.Enabled = False
Command4.Enabled = False
End Sub
 
Private Sub dateview1()
If Data1.Recordset.BOF And Data1.Recordset.EOF Then
inta = MsgBox("请增加试题", vbYesNo, "温馨提示")
Else
Text14.Text = Data1.Recordset.Fields("tinglilujing")
Text12.Text = Data1.Recordset.Fields("shijuanlujing")
Text13.Text = Data1.Recordset.Fields("daanlujing")
Text9.Text = Data1.Recordset.Fields("shijuanmingcheng")
Text11.Text = Data1.Recordset.Fields("shijuantongguolv")
End If
End Sub
Private Sub dateview2()
If Data1.Recordset.BOF And Data1.Recordset.EOF Then
inta = MsgBox("请增加试题", vbYesNo, "温馨提示")
Else
Text20.Text = Data1.Recordset.Fields("tinglilujing")
Text18.Text = Data1.Recordset.Fields("shijuanlujing")
Text19.Text = Data1.Recordset.Fields("daanlujing")
Text15.Text = Data1.Recordset.Fields("shijuanmingcheng")
Text17.Text = Data1.Recordset.Fields("shijuantongguolv")
End If
End Sub
Private Sub dateview3()
If Data1.Recordset.BOF And Data1.Recordset.EOF Then
inta = MsgBox("请增加试题", vbYesNo, "温馨提示")
Else
Text26.Text = Data1.Recordset.Fields("tinglilujing")
Text24.Text = Data1.Recordset.Fields("shijuanlujing")
Text25.Text = Data1.Recordset.Fields("daanlujing")
Text21.Text = Data1.Recordset.Fields("shijuanmingcheng")
Text23.Text = Data1.Recordset.Fields("shijuantongguolv")
End If
End Sub


Private Sub SSTab1_Click(PreviousTab As Integer)
Select Case PreviousTab
Case 0
Case 1

Case 2

Case 3

End Select
End Sub


Private Sub Text15_GotFocus()
Command4.Enabled = True
End Sub
Private Sub Text16_GotFocus()
Command4.Enabled = True
End Sub
Private Sub Text17_GotFocus()
Command4.Enabled = True
End Sub
Private Sub Text18_GotFocus()
Command4.Enabled = True
End Sub
Private Sub Text19_GotFocus()
Command4.Enabled = True
End Sub
Private Sub Text120_GotFocus()
Command4.Enabled = True
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -