?? adddept.frm
字號:
VERSION 5.00
Begin VB.Form addDept
BorderStyle = 1 'Fixed Single
Caption = "添加系別"
ClientHeight = 1860
ClientLeft = 45
ClientTop = 330
ClientWidth = 3870
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 1860
ScaleWidth = 3870
Begin VB.CommandButton Command2
Caption = "返回(&B)"
Height = 375
Left = 2400
TabIndex = 3
Top = 1320
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "保存(&S)"
Height = 375
Left = 240
TabIndex = 2
Top = 1320
Width = 1215
End
Begin VB.Frame Frame1
Caption = "系別名稱"
Height = 975
Left = 120
TabIndex = 0
Top = 120
Width = 3615
Begin VB.TextBox Text1
Height = 375
Left = 360
TabIndex = 1
Top = 360
Width = 2895
End
End
End
Attribute VB_Name = "addDept"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim txtSQL As String
Dim MsgText As String
Dim MRC As ADODB.Recordset
Dim insSQL As String
Dim InsText As String
Dim INS As ADODB.Recordset
Dim DeptID As Integer
If Not Testtxt(Text1) Then
MsgBox "請輸入系別名稱!", vbOKOnly + vbExclamation, "學籍管理系統"
Exit Sub
End If
txtSQL = "SELECT * FROM Department WHERE DeptName='" & Text1.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
If Not (MRC.EOF) Then
MsgBox "該系別名稱已經寫入數據庫中!", vbOKOnly + vbExclamation, "成績管理系統"
Text1.Text = ""
Text1.SetFocus
Exit Sub
End If
txtSQL = "SELECT COUNT(*) FROM Department WHERE DeptID>0"
Set MRC = ExecuteSQL(txtSQL, MsgText)
If (MRC.Fields(0).Value = 0) Then
DeptID = 1
Else
DeptID = MRC.Fields(0).Value + 1
End If
insSQL = "INSERT INTO Department VALUES(" & DeptID & " ,'" & Text1.Text & "')"
Set INS = ExecuteSQL(insSQL, InsText)
Call Module1.JUDGE(InsText, addDept)
Text1.Text = ""
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Move (frmMain.ScaleWidth - Me.Width) / 2, (frmMain.ScaleHeight - Me.Height) / 2
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -