?? 考試違規(guī).frm
字號(hào):
ColumnWidth = 3960
EndProperty
EndProperty
End
Begin VB.TextBox Text9
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 720
TabIndex = 17
Text = "Text9"
Top = 2400
Width = 9615
End
Begin VB.TextBox Text8
Height = 375
Left = 1080
TabIndex = 15
Text = "Text8"
Top = 1920
Width = 6015
End
Begin VB.TextBox Text7
Height = 375
Left = 6480
TabIndex = 13
Text = "Text7"
Top = 1440
Width = 3735
End
Begin VB.TextBox Text6
Height = 375
Left = 1080
TabIndex = 12
Text = "Text6"
Top = 1440
Width = 3255
End
Begin VB.TextBox Text4
Height = 375
Left = 840
TabIndex = 7
Text = "Text4"
Top = 960
Width = 2295
End
Begin VB.TextBox Text3
Height = 375
Left = 7920
TabIndex = 5
Text = "Text3"
Top = 480
Width = 2295
End
Begin VB.TextBox Text2
Height = 375
Left = 4440
TabIndex = 3
Text = "Text2"
Top = 480
Width = 2295
End
Begin VB.TextBox Text1
Height = 375
Left = 840
TabIndex = 1
Text = "Text1"
Top = 480
Width = 2295
End
Begin VB.Label Label10
Caption = "備注:"
Height = 255
Left = 120
TabIndex = 16
Top = 2400
Width = 735
End
Begin VB.Label Label9
Caption = "違紀(jì)類型:"
Height = 255
Left = 120
TabIndex = 14
Top = 1920
Width = 1095
End
Begin VB.Label Label8
Caption = "考試地點(diǎn):"
Height = 255
Left = 5400
TabIndex = 11
Top = 1440
Width = 1095
End
Begin VB.Label Label7
Caption = "考試科目:"
Height = 255
Left = 120
TabIndex = 10
Top = 1440
Width = 1095
End
Begin VB.Label Label6
Caption = "考試時(shí)間:"
Height = 255
Left = 6960
TabIndex = 9
Top = 960
Width = 1095
End
Begin VB.Label Label5
Caption = "學(xué)期:"
Height = 255
Left = 3720
TabIndex = 8
Top = 960
Width = 735
End
Begin VB.Label Label4
Caption = "專業(yè):"
Height = 255
Left = 120
TabIndex = 6
Top = 960
Width = 735
End
Begin VB.Label Label3
Caption = "年級(jí):"
Height = 255
Left = 7200
TabIndex = 4
Top = 480
Width = 735
End
Begin VB.Label Label2
Caption = "姓名:"
Height = 255
Left = 3720
TabIndex = 2
Top = 480
Width = 735
End
Begin VB.Label Label1
Caption = "學(xué)號(hào):"
Height = 255
Left = 120
TabIndex = 0
Top = 480
Width = 735
End
End
Attribute VB_Name = "Frm_StruWeiG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim XueHao, XingMing, NianJi, ZhuanYe, XueQi, KaoSSJ, KaoSKM, KaoSDD, WeiJLX, BZ As String
XueHao = Text1.Text
XingMing = Text2.Text
NianJi = Text3.Text
ZhuanYe = Text4.Text
XueQi = DTPicker1.Value
KaoSSJ = DTPicker2.Value
KaoSKM = Text6.Text
KaoSDD = Text7.Text
WeiJLX = Text8.Text
BZ = Text9.Text
If Trim(XueHao) = "" Or Trim(XingMing) = "" Or Trim(NianJi) = "" Or Trim(ZhuanYe) = "" Or Trim(KaoSKM) = "" Or Trim(KaoSDD) = "" Then
MsgBox "學(xué)生考試違規(guī)資料不能為空,請(qǐng)?zhí)顚懀?quot;
Exit Sub
End If
myCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;"
myRs.Open "select * from 成績(jī)表 where 學(xué)號(hào) = '" & XueHao & "'", myCon
If myRs.EOF = False Then
MsgBox "該學(xué)生已經(jīng)存在,請(qǐng)重新輸入!"
myRs.Close
myCon.Close
Text1.SetFocus
Exit Sub
End If
myRs.Close
myRs.Open "成績(jī)表", myCon, 3, 2
myRs.AddNew
myRs.Fields("學(xué)號(hào)") = Text1.Text
myRs.Fields("姓名") = Text2.Text
myRs.Fields("年級(jí)") = Text3.Text
myRs.Fields("專業(yè)") = Text4.Text
myRs.Fields("學(xué)期") = DTPicker1.Value
myRs.Fields("考試時(shí)間") = DTPicker2.Value
myRs.Fields("考試科目") = Text6.Text
myRs.Fields("考試地點(diǎn)") = Text7.Text
myRs.Fields("違紀(jì)類型") = Text8.Text
If Text9.Text = "" Then
Text9.Text = " "
Else
myRs.Fields("備注") = Text9.Text
End If
myRs.Update
myRs.Close
myCon.Close
MsgBox "添加成功!"
Frm_StruWeiG.Adodc1.RecordSource = "select 學(xué)號(hào),姓名,年級(jí),專業(yè),學(xué)期,考試時(shí)間,考試科目,考試地點(diǎn),違紀(jì)類型,備注 from 成績(jī)表 order by 學(xué)號(hào)"
Frm_StruWeiG.Adodc1.Refresh
Frm_StruWeiG.DataGrid1.Refresh
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
'Combo1.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Command2_Click()
Dim XueHao, XingMing, NianJi, ZhuanYe, XueQi, KaoSSJ, KaoSKM, KaoSDD, WeiJLX, BZ As String
Dim n As Integer
XueHao = Text1.Text
XingMing = Text2.Text
NianJi = Text3.Text
ZhuanYe = Text4.Text
XueQi = DTPicker1.Value
KaoSSJ = DTPicker2.Value
KaoSKM = Text6.Text
KaoSDD = Text7.Text
WeiJLX = Text8.Text
BZ = Text9.Text
If Trim(XueHao) = "" Or Trim(XingMing) = "" Or Trim(NianJi) = "" Or Trim(ZhuanYe) = "" Or Trim(KaoSKM) = "" Or Trim(KaoSDD) = "" Then
MsgBox "請(qǐng)?zhí)顚懸獎(jiǎng)h除成績(jī)的資料!"
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 成績(jī)表 where 學(xué)號(hào)='" & Text1.Text & "'", myCon, 3, 2
n = MsgBox("您確定要?jiǎng)h除嗎?", vbYesNo, "提示")
If n = 6 Then
myRs.Delete
myRs.Close
myCon.Close
End If
'MsgBox "您確定要?jiǎng)h除嗎?", vbYesNo, "提示"
Frm_StruWeiG.Adodc1.RecordSource = "select 學(xué)號(hào),姓名,年級(jí),專業(yè),學(xué)期,考試時(shí)間,考試科目,考試地點(diǎn),違紀(jì)類型,備注 from 成績(jī)表 order by 學(xué)號(hào)"
Frm_StruWeiG.Adodc1.Refresh
Frm_StruWeiG.DataGrid1.Refresh
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
'Combo1.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub DataGrid1_Click()
Frm_StruWeiG.Adodc1.RecordSource = "select * from 成績(jī)表 where 學(xué)號(hào) = '" & Trim(DataGrid1.Row) & "'"
Text1.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("學(xué)號(hào)")
Text2.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("姓名")
Text3.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("年級(jí)")
Text4.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("專業(yè)")
'Text5.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("學(xué)期")
'Combo1.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("考試時(shí)間")
Text6.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("考試科目")
Text7.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("考試地點(diǎn)")
If Text8.Text = "" Then
Text8.Text = ""
Else
Text8.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("違紀(jì)類型")
End If
If Text9.Text = "" Then
Text9.Text = ""
Else
Text9.Text = Frm_StruWeiG.Adodc1.Recordset.Fields("備注")
End If
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;Persist Security Info=False"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
'Combo1.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -