📄 frminput.frm
字号:
Index = 9
Left = 120
TabIndex = 9
Top = 1920
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "院系:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 8
Left = 120
TabIndex = 8
Top = 2640
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "电话号码:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 7
Left = 2880
TabIndex = 7
Top = 2640
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "专业:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 6
Left = 5880
TabIndex = 6
Top = 1920
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "出生年月:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 5
Left = 2880
TabIndex = 5
Top = 1080
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "民族:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 4
Left = 8040
TabIndex = 4
Top = 360
Width = 855
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "地址:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 3
Left = 5880
TabIndex = 3
Top = 1080
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "父母姓名:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 120
TabIndex = 2
Top = 1080
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "性别:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 1
Left = 5880
TabIndex = 1
Top = 360
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
Caption = "名字:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 2880
TabIndex = 0
Top = 360
Width = 975
End
End
Attribute VB_Name = "FrmView"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As ADODB.Recordset
Dim rs1 As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
Dim mybookmark As Variant
Dim mcclean As Boolean
'Private Sub Combo1_Change()
'Combo1.AddItem "男"
'Combo1.AddItem "女"
'End Sub
Private Sub Command1_Click()
On Error GoTo errh
If Combo4.Text <> "" Then
If Combo2.Text <> "" Then
If Text1.Text <> "" Then
If Text13.Text <> "" Then
If Combo3.Text <> "" Then
If checkclass Then
If checkcourse Then
If match = True Then
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("课程号").Value = Combo4.Text
Adodc1.Recordset.Fields("学号").Value = Text1.Text
Adodc1.Recordset.Fields("成绩").Value = Text13.Text
Adodc1.Recordset.Fields("课程名称").Value = Combo2.Text
Adodc1.Recordset.Fields("备注").Value = Combo3.Text
Adodc1.Recordset.Update
MsgBox "添加成功!"
Combo4.Text = ""
Combo2.Text = ""
Combo3.Text = ""
'Text2.Text = ""
Text13.Text = ""
Else
MsgBox "成绩和备注不匹配,请核对!"
End If
Else
MsgBox "没有这个课程,不能添加!"
Combo3.Text = ""
Text13.Text = ""
Combo4.Text = ""
Combo2.Text = ""
Combo4.SetFocus
End If
Else
MsgBox "这个成绩已经有了,不能再添加!"
End If
Else
MsgBox "备注不能为空,请输入备注!"
Combo3.SetFocus
End If
Else
MsgBox "成绩不能为空,请输入成绩!"
Text13.SetFocus
End If
Else
MsgBox "学号不能为空,请输入学号!"
Text1.SetFocus
End If
Else
MsgBox "课程名称不能为空,请输入课程名称!"
Combo2.SetFocus
End If
Else
MsgBox "课程号不能为空,请输入课程号!"
Combo4.SetFocus
End If
Exit Sub
errh:
MsgBox Err.Description
End Sub
Private Sub CmdBolish_Click()
On Error GoTo AddErr
If Not mcclean Then
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command10.Enabled = True
'Text1.Enabled = False
'Text2.Enabled = False
'Text3.Enabled = False
'Text4.Enabled = False
'Text5.Enabled = False
'Text6.Enabled = False
'Text7.Enabled = False
'Text8.Enabled = False
'Text9.Enabled = False
'Combo1.Enabled = False
'DataCombo1.Enabled = False
'Text10.Enabled = False
'Text12.Enabled = False
' Adodc2.Recordset.Bookmark = mybookmark
Else
MsgBox "什么也没修改,无所谓取消不取消!", vbOKOnly + vbExclamation, "警告"
End If
Exit Sub
AddErr:
MsgBox Err.Description
End Sub
Private Sub CmdUpdata_Click()
If mcclean = True Then
MsgBox "请先修改学籍信息", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
If Text1.Text = "" Then
MsgBox "请输入学号!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "请输入名字!", vbOKOnly + vbExclamation, "警告"
Text2.SetFocus
Exit Sub
End If
If Combo1.Text = "" Then
MsgBox "请输入性别!", vbOKOnly + vbExclamation, "警告"
Combo1.SetFocus
Exit Sub
End If
If Text5.Text = "" Then
MsgBox "请输入民族!"
Text5.SetFocus
Exit Sub
End If
If Text6.Text = "" Then
MsgBox "请输入父母姓名!", vbOKOnly + vbExclamation, "警告"
Text6.SetFocus
Exit Sub
End If
If Text4.Text = "" Then
MsgBox "请输入出生年月!出生年月应输入日期格式(YYYY-MM-DD)!", vbOKOnly + vbExclamation, "警告"
Text4.SetFocus
Exit Sub
End If
If Text7.Text = "" Then
MsgBox "请输入地址!", vbOKOnly + vbExclamation, "警告"
Text7.SetFocus
Exit Sub
End If
If Text8.Text = "" Then
MsgBox "请输入邮政编码!", vbOKOnly + vbExclamation, "警告"
Text8.SetFocus
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "请输入班级!", vbOKOnly + vbExclamation, "警告"
Text3.SetFocus
Exit Sub
End If
If DataCombo1.Text = "" Then
MsgBox "请输入专业!", vbOKOnly + vbExclamation, "警告"
DataCombo1.SetFocus
Exit Sub
End If
If Text10.Text = "" Then
MsgBox "请输入院系!", vbOKOnly + vbExclamation, "警告"
Text10.SetFocus
Exit Sub
End If
If Text9.Text = "" Then
MsgBox "请输入电话号码!", vbOKOnly + vbExclamation, "警告"
Text9.SetFocus
Exit Sub
End If
End If
If check1 = False Then
If Text1.Text <> Adodc2.Recordset.Fields("学号") Then
MsgBox "学号重复", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Else
' Adodc2.Recordset.AddNew
Adodc2.Recordset.Fields("学号").Value = Text1.Text
Adodc2.Recordset.Fields("名字").Value = Text2.Text
Adodc2.Recordset.Fields("班级").Value = Text3.Text
Adodc2.Recordset.Fields("性别").Value = Combo1.Text
Adodc2.Recordset.Fields("出生年月").Value = Text4.Text
Adodc2.Recordset.Fields("民族").Value = Text5.Text
Adodc2.Recordset.Fields("父母姓名").Value = Text6.Text
Adodc2.Recordset.Fields("地址").Value = Text7.Text
Adodc2.Recordset.Fields("邮政编码").Value = Text8.Text
Adodc2.Recordset.Fields("电话号码").Value = Text9.Text
Adodc2.Recordset.Fields("院系").Value = Text10.Text
Adodc2.Recordset.Fields("专业").Value = DataCombo1.Text
Adodc2.Recordset.Fields("附注").Value = Text12.Text
Adodc2.Recordset.Update
'Adodc2.Recordset.Close
MsgBox "修改学籍信息成功!", vbOKOnly + vbExclamation, "修改学籍信息"
' Adodc2.Recordset.Bookmark = mybookmark
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command10.Enabled = True
'Text1.Enabled = False
'Text2.Enabled = False
'Text3.Enabled = False
'Text4.Enabled = False
'Text5.Enabled = False
'Text6.Enabled = False
'Text7.Enabled = False
'Text8.Enabled = False
'Text9.Enabled = False
'Combo1.Enabled = False
'DataCombo1.Enabled = False
'Text10.Enabled = False
'Text12.Enabled = False
mcclean = True
End If
Else
Adodc2.Recordset.Fields("学号").Value = Text1.Text
Adodc2.Recordset.Fields("名字").Value = Text2.Text
Adodc2.Recordset.Fields("班级").Value = Text3.Text
Adodc2.Recordset.Fields("性别").Value = Combo1.Text
Adodc2.Recordset.Fields("出生年月").Value = Text4.Text
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -