📄 formaddstu.frm
字号:
EndProperty
Height = 375
Left = 6720
TabIndex = 32
Top = 120
Width = 975
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "民 族:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6720
TabIndex = 31
Top = 600
Width = 975
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "出生日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 30
Top = 3000
Width = 1215
End
Begin VB.Label Label10
BackStyle = 0 'Transparent
Caption = "籍 贯:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 29
Top = 2040
Width = 855
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "家庭出身:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 28
Top = 2520
Width = 1215
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "本人成份:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 27
Top = 2040
Width = 1215
End
Begin VB.Label Label13
BackStyle = 0 'Transparent
Caption = "政治面貌:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3600
TabIndex = 26
Top = 1080
Width = 1215
End
Begin VB.Label Label14
BackStyle = 0 'Transparent
Caption = "考生来源:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3600
TabIndex = 25
Top = 1560
Width = 1215
End
Begin VB.Label Label15
BackStyle = 0 'Transparent
Caption = "家庭住址:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3600
TabIndex = 24
Top = 2520
Width = 1215
End
Begin VB.Label Label16
BackStyle = 0 'Transparent
Caption = "家庭邮政编码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 23
Top = 3960
Width = 1695
End
Begin VB.Label Label17
BackStyle = 0 'Transparent
Caption = "家庭电话:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 22
Top = 3480
Width = 1215
End
Begin VB.Label Label27
BackStyle = 0 'Transparent
Caption = "出生年月日的输入格式:年-月-日 例:1984-08-03"
ForeColor = &H000000FF&
Height = 255
Left = 3960
TabIndex = 21
Top = 3000
Width = 4575
End
Begin VB.Label Label28
BackStyle = 0 'Transparent
Caption = "家庭电话输入格式:区号-家庭电话号码 例:010-12345678"
ForeColor = &H000000FF&
Height = 255
Left = 3720
TabIndex = 20
Top = 3480
Width = 4935
End
End
Attribute VB_Name = "FormAddstu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Mrc As ADODB.Recordset
Dim txtSQL As String
Dim Msgtext As String
Private Sub Command1_Click()
If Not IsNumeric(Text1) Then
MsgBox "学号输入有误!", vbOKOnly + vbExclamation, "提示"
Text1.SetFocus
Exit Sub
End If
If Text5.Text = "" Then
MsgBox "姓名不可为空!", vbOKOnly + vbExclamation, "错误"
Text5.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "系别不可为空!", vbOKOnly + vbExclamation, "错误"
Text2.SetFocus
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "专业不可为空!", vbOKOnly + vbExclamation, "错误"
Text3.SetFocus
Exit Sub
End If
If Text4.Text = "" Then
MsgBox "班号不可为空!", vbOKOnly + vbExclamation, "错误"
Text4.SetFocus
Exit Sub
End If
txtSQL = "select * from 基本信息 where 学号=' " & Trim(Text1) & " '"
Set Mrc = ExecuteSQL(txtSQL, Msgtext)
If Mrc.EOF = False Then
MsgBox "此学号已存在!", vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
End If
Mrc.Close
txtSQL = "select * from 基本信息"
Set Mrc = ExecuteSQL(txtSQL, Msgtext)
Mrc.AddNew
Mrc.Fields(0) = Trim(Text1)
Mrc.Fields(1) = Trim(Text2)
Mrc.Fields(2) = Trim(Text3)
Mrc.Fields(3) = Trim(Text4)
Mrc.Fields(4) = Trim(Text5)
Mrc.Fields(5) = Trim(Text6)
Mrc.Fields(6) = Trim(Text7)
Mrc.Fields(7) = Trim(Text8)
Mrc.Fields(8) = Trim(Text9)
Mrc.Fields(9) = Trim(Text10)
Mrc.Fields(10) = Trim(Text11)
Mrc.Fields(11) = Trim(Text12)
Mrc.Fields(12) = Trim(Text13)
Mrc.Fields(13) = Trim(Text14)
Mrc.Fields(14) = Trim(Text15)
Mrc.Fields(15) = Trim(Text16)
Mrc.Fields(16) = Trim(Text17)
Mrc.Fields(17) = Trim(Text18)
Mrc.Update
Mrc.Close
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = "1982-10-13"
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
MsgBox "信息添加成功!", vbOKOnly, "提示"
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
End Sub
Private Sub Form_Load()
Set Mrc = New ADODB.Recordset
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -