?? 課程設置.frm
字號:
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 10
Text = "Text6"
Top = 1440
Width = 1935
End
Begin VB.TextBox Text5
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6720
TabIndex = 7
Text = "Text5"
Top = 960
Width = 3495
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 6
Text = "Text4"
Top = 960
Width = 3255
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 3
Text = "Text2"
Top = 480
Width = 2295
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 1
Text = "Text1"
Top = 480
Width = 2055
End
Begin VB.Label Label10
Caption = "考試性質:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 5880
TabIndex = 17
Top = 1920
Width = 1095
End
Begin VB.Label Label9
Caption = "課程性質:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 15
Top = 1920
Width = 1095
End
Begin VB.Label Label8
Caption = "上課地點:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7320
TabIndex = 13
Top = 1560
Width = 1095
End
Begin VB.Label Label7
Caption = "課時:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3720
TabIndex = 11
Top = 1560
Width = 735
End
Begin VB.Label Label6
Caption = "任課老師:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 9
Top = 1440
Width = 1095
End
Begin VB.Label Label5
Caption = "教材:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 5880
TabIndex = 8
Top = 960
Width = 1095
End
Begin VB.Label Label4
Caption = "課程名稱:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 5
Top = 960
Width = 1095
End
Begin VB.Label Label3
Caption = "學期:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7200
TabIndex = 4
Top = 480
Width = 735
End
Begin VB.Label Label2
Caption = "年級:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3720
TabIndex = 2
Top = 480
Width = 735
End
Begin VB.Label Label1
Caption = "專業:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 0
Top = 480
Width = 735
End
End
Attribute VB_Name = "Frm_SheZGrean"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim myCon As New ADODB.Connection
Dim myRs As New ADODB.Recordset
Private Sub Command1_Click()
Dim ZhuanYe, NianJi, KeCheng, JiaoCai, RenKLS, KeShi, ShangKeDD, KeChengXZ, KaoShiXZ As String
ZhuanYe = Text1.Text
NianJi = Text2.Text
XueQi = DTPicker1.Value
KeCheng = Text4.Text
JiaoCai = Text5.Text
RenKLS = Text6.Text
KeShi = Text7.Text
ShangKeDD = Text8.Text
KeChengXZ = Combo1.Text
KaoShiXZ = Combo2.Text
If Trim(ZhuanYe) = "" Or Trim(NianJi) = "" Or Trim(KeCheng) = "" Or Trim(JiaoCai) = "" Or Trim(RenKLS) = "" Or Trim(KeShi) = "" Or Trim(ShangKeDD) = "" Or Trim(KeChengXZ) = "" Or Trim(KaoShiXZ) = "" Then
MsgBox "基本課程設置資料不能為空,請填寫完整!"
Combo1.Text = ""
Combo2.Text = ""
Exit Sub
End If
myCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;"
myRs.Open "select * from 課程表 where 專業= '" & Trim(Text1.Text) & "' and 年級='" & Trim(Text2.Text) & "' and 課程名稱='" & Trim(Text4.Text) & "' ", myCon
If myRs.EOF = False Then
MsgBox "該課程已經存在,請重新輸入!"
myRs.Close
myCon.Close
Text1.SetFocus
Exit Sub
End If
myRs.Close
myRs.Open "課程表", myCon, 3, 2
myRs.AddNew
myRs.Fields("專業") = Text1.Text
myRs.Fields("年級") = Text2.Text
myRs.Fields("學期") = DTPicker1.Value
myRs.Fields("課程名稱") = Text4.Text
myRs.Fields("教材") = Text5.Text
myRs.Fields("任課老師") = Text6.Text
myRs.Fields("課時") = Text7.Text
myRs.Fields("上課地點") = Text8.Text
myRs.Fields("課程性質") = Combo1.Text
myRs.Fields("考試性質") = Combo2.Text
myRs.Update
myRs.Close
myCon.Close
MsgBox "添加成功!"
Adodc1.RecordSource = "select * from 課程表 order by 專業"
Frm_SheZGrean.Adodc1.Refresh
Frm_SheZGrean.DataGrid1.Refresh
Text1.Text = ""
Text2.Text = ""
'Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
End Sub
Private Sub Command2_Click()
Dim ZhuanYe, NianJi, KeCheng, JiaoCai, RenKLS, KeShi, ShangKeDD, KeChengXZ, KaoShiXZ As String
Dim n As Integer
ZhuanYe = Text1.Text
NianJi = Text2.Text
XueQi = DTPicker1.Value
KeCheng = Text4.Text
JiaoCai = Text5.Text
RenKLS = Text6.Text
KeShi = Text7.Text
ShangKeDD = Text8.Text
KeChengXZ = Combo1.Text
KaoShiXZ = Combo2.Text
If Trim(ZhuanYe) = "" Or Trim(NianJi) = "" Or Trim(KeCheng) = "" Or Trim(JiaoCai) = "" Or Trim(RenKLS) = "" Or Trim(KeShi) = "" Or Trim(ShangKeDD) = "" Or Trim(KeChengXZ) = "" Or Trim(KaoShiXZ) = "" Then
MsgBox "請填寫要刪除基本課程設置的資料!"
Combo1.Text = ""
Combo2.Text = ""
Exit Sub
End If
If myCon.State = 1 Then
myCon.Close
End If
myCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;"
myRs.Open "select * from 課程表 where 專業='" & Text1.Text & "'", myCon, 3, 2
n = MsgBox("您確定要刪除嗎?", vbYesNo, "提示")
If n = 6 Then
myRs.Delete
myRs.Close
myCon.Close
End If
'MsgBox "您確定要刪除嗎?", vbYesNo, "提示"
Adodc1.RecordSource = "select * from 課程表 order by 專業"
Frm_SheZGrean.Adodc1.Refresh
Frm_SheZGrean.DataGrid1.Refresh
Text1.Text = ""
Text2.Text = ""
'Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub DataGrid1_Click()
Frm_SheZGrean.Adodc1.RecordSource = "select * from 課程表 where 專業 = '" & Trim(DataGrid1.Row) & "'"
Text1.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("專業")
Text2.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("年級")
'Text3.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("學期")
Text4.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("課程名稱")
Text5.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("教材")
Text6.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("任課老師")
Text7.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("課時")
Text8.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("上課地點")
Combo1.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("課程性質")
Combo2.Text = Frm_SheZGrean.Adodc1.Recordset.Fields("考試性質")
Command2.Enabled = True
End Sub
Private Sub Form_Load()
Combo1.AddItem ("必修")
Combo1.AddItem ("選修")
Combo1.AddItem ("自開")
Combo2.AddItem ("考試")
Combo2.AddItem ("查考")
Text1.Text = ""
Text2.Text = ""
'Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -