?? frmcourseinfo.frm
字號:
VERSION 5.00
Begin VB.Form frmAddcourseinfo
Caption = "添加課程信息"
ClientHeight = 3612
ClientLeft = 48
ClientTop = 348
ClientWidth = 7344
LinkTopic = "Form1"
ScaleHeight = 3612
ScaleWidth = 7344
StartUpPosition = 3 'Windows Default
Begin VB.ComboBox comboCoursetype
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 312
Left = 1560
TabIndex = 9
Top = 1200
Width = 1332
End
Begin VB.CommandButton Command2
Caption = "取消添加"
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 3840
TabIndex = 8
Top = 2760
Width = 1452
End
Begin VB.CommandButton Command1
Caption = "確認添加"
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 1320
TabIndex = 7
Top = 2760
Width = 1452
End
Begin VB.TextBox txtCoursedes
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1452
Left = 4680
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 6
Top = 1080
Width = 2412
End
Begin VB.TextBox txtCoursename
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 4680
TabIndex = 3
Top = 240
Width = 1332
End
Begin VB.TextBox txtCourseno
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 1560
TabIndex = 1
Top = 240
Width = 1332
End
Begin VB.Label Label4
Caption = "課程描述:"
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 3360
TabIndex = 5
Top = 1200
Width = 1212
End
Begin VB.Label Label3
Caption = "課程類型:"
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 4
Top = 1200
Width = 1212
End
Begin VB.Label Label2
Caption = "課程名稱:"
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 3360
TabIndex = 2
Top = 360
Width = 1212
End
Begin VB.Label Label1
Caption = "課程編號:"
BeginProperty Font
Name = "宋體"
Size = 10.8
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 0
Top = 360
Width = 1212
End
End
Attribute VB_Name = "frmAddcourseinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim txtSQL As String
If Not Testtxt(txtCourseno.Text) Then
MsgBox "請輸入課程編號!", vbOKOnly + vbExclamation, "警告"
txtCourseno.SetFocus
Exit Sub
End If
If Not Testtxt(txtCoursename.Text) Then
MsgBox "請輸入課程名稱!", vbOKOnly + vbExclamation, "警告"
txtCoursename.SetFocus
Exit Sub
End If
If Not Testtxt(comboCoursetype.Text) Then
MsgBox "請選擇課程類型!", vbOKOnly + vbExclamation, "警告"
comboCoursetype.SetFocus
Exit Sub
End If
If Not Testtxt(txtCoursedes.Text) Then
MsgBox "請輸入課程描述信息!", vbOKOnly + vbExclamation, "警告"
txtCoursedes.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtCourseno.Text)) Then
MsgBox "請輸入數字編號!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtCourseno.SetFocus
End If
txtSQL = "select * from course_Info "
Set mrc = ExecuteSQL(txtSQL, MsgText)
While (mrc.EOF = False)
If (Trim(mrc.Fields(0)) = Trim(txtCourseno.Text)) Then
MsgBox "課程編號已經存在,請重新輸入課程編號!", vbOKOnly + vbExclamation, "警告"
txtCourseno.Text = ""
txtCourseno.SetFocus
Exit Sub
Else
mrc.MoveNext
End If
Wend
mrc.AddNew
mrc.Fields(0) = Trim(txtCourseno.Text)
mrc.Fields(1) = Trim(txtCoursename.Text)
mrc.Fields(2) = Trim(comboCoursetype.Text)
mrc.Fields(3) = Trim(txtCoursedes.Text)
mrc.Update
mrc.Close
MsgBox "添加課程信息成功!", vbOKOnly + vbExclamation, "添加課程信息"
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
comboCoursetype.AddItem "必修"
comboCoursetype.AddItem "考查"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -