📄 frmstuadd.frm
字号:
VERSION 5.00
Begin VB.Form FrmStuAdd
BackColor = &H80000016&
Caption = "添加"
ClientHeight = 5220
ClientLeft = 60
ClientTop = 450
ClientWidth = 9105
LinkTopic = "Form1"
ScaleHeight = 5220
ScaleWidth = 9105
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox txtClass_ID
Height = 375
Left = 7320
TabIndex = 13
Top = 3120
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 5760
TabIndex = 15
Top = 4440
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 1680
TabIndex = 14
Top = 4440
Width = 1455
End
Begin VB.ComboBox ComboSex
Height = 300
ItemData = "FrmStuAdd.frx":0000
Left = 4560
List = "FrmStuAdd.frx":000A
TabIndex = 2
Top = 360
Width = 975
End
Begin VB.TextBox txtBirth
Height = 270
Left = 1200
TabIndex = 4
Top = 960
Width = 1455
End
Begin VB.TextBox txtTitle
Height = 270
Left = 7320
TabIndex = 6
Top = 960
Width = 1455
End
Begin VB.TextBox txtBadgeID
Height = 270
Left = 7320
TabIndex = 8
Top = 1800
Width = 1455
End
Begin VB.TextBox txtHomePhone
Height = 270
Left = 7320
TabIndex = 10
Top = 2520
Width = 1455
End
Begin VB.TextBox txtInDate
Height = 270
Left = 4320
TabIndex = 12
Top = 3240
Width = 1455
End
Begin VB.TextBox txtPostcode
Height = 270
Left = 1200
TabIndex = 11
Top = 3240
Width = 1455
End
Begin VB.TextBox txtResidence
Height = 270
Left = 1200
TabIndex = 9
Top = 2520
Width = 4695
End
Begin VB.TextBox txtId_Card
Height = 270
Left = 1200
TabIndex = 7
Top = 1680
Width = 4695
End
Begin VB.TextBox txtFamily_place
Height = 270
Left = 4320
TabIndex = 5
Top = 960
Width = 1455
End
Begin VB.TextBox txtNationality
Height = 270
Left = 7320
TabIndex = 3
Top = 360
Width = 1455
End
Begin VB.TextBox txtStu_Name
Height = 270
Left = 1200
TabIndex = 1
Top = 360
Width = 1455
End
Begin VB.Label Label13
BackColor = &H80000016&
Caption = "班级编号:"
Height = 375
Left = 6240
TabIndex = 27
Top = 3120
Width = 975
End
Begin VB.Label Label3
BackColor = &H80000016&
Caption = "民族"
Height = 375
Left = 6240
TabIndex = 26
Top = 360
Width = 1215
End
Begin VB.Label Label6
BackColor = &H80000016&
Caption = "职务"
Height = 375
Left = 6240
TabIndex = 25
Top = 960
Width = 1215
End
Begin VB.Label Label8
BackColor = &H80000016&
Caption = "学生证号"
Height = 375
Left = 6240
TabIndex = 24
Top = 1800
Width = 1215
End
Begin VB.Label Label10
BackColor = &H80000016&
Caption = "家庭电话"
Height = 375
Left = 6240
TabIndex = 23
Top = 2520
Width = 1215
End
Begin VB.Label Label12
BackColor = &H80000016&
Caption = "入校日期"
Height = 375
Left = 3240
TabIndex = 22
Top = 3240
Width = 1215
End
Begin VB.Label Label1
BackColor = &H80000016&
Caption = "学生姓名"
Height = 375
Left = 240
TabIndex = 21
Top = 360
Width = 1215
End
Begin VB.Label Label11
BackColor = &H80000016&
Caption = "邮政编码"
Height = 375
Left = 240
TabIndex = 20
Top = 3165
Width = 1215
End
Begin VB.Label Label9
BackColor = &H80000016&
Caption = "居住地址"
Height = 375
Left = 240
TabIndex = 19
Top = 2496
Width = 1215
End
Begin VB.Label Label7
BackColor = &H80000016&
Caption = "身份证号"
Height = 375
Left = 240
TabIndex = 18
Top = 1704
Width = 1215
End
Begin VB.Label Label5
BackColor = &H80000016&
Caption = "籍贯"
Height = 375
Left = 3360
TabIndex = 17
Top = 960
Width = 1215
End
Begin VB.Label Label4
BackColor = &H80000016&
Caption = "出生日期"
Height = 375
Left = 240
TabIndex = 16
Top = 912
Width = 1215
End
Begin VB.Label Label2
BackColor = &H80000016&
Caption = "性别"
Height = 375
Left = 3360
TabIndex = 0
Top = 360
Width = 1215
End
End
Attribute VB_Name = "FrmStuAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriStudent_Id As Integer
Private Sub Command1_Click() '添加学生信息
If Trim(txtStu_Name) = "" Then
MsgBox "请输入学生姓名"
txtEmpName.SetFocus
Exit Sub
End If
If Trim(txtBadgeID) = "" Then
MsgBox "请输入学生证号"
txtBadgeID.SetFocus
Exit Sub
End If
With MyStu
.Student_Name = MakeStr(txtStu_Name)
.Sex = ComboSex.Text
.Nationality = MakeStr(txtNationality)
If IsDate(txtBirth.Text) = False Then
MsgBox "请输入正确的出生日期"
txtBirth.SetFocus
Exit Sub
End If
.Birth = MakeStr(txtBirth)
.Family_Place = MakeStr(txtFamily_place)
.Id_Card = MakeStr(txtId_Card)
.BadgeID = MakeStr(txtBadgeID)
.Home_phone = MakeStr(txtHomePhone)
.Residence = MakeStr(txtResidence)
.Postcode = MakeStr(txtPostcode)
If IsDate(txtInDate.Text) = False Then
MsgBox "请输入正确的入校日期"
Exit Sub
End If
.InDate = MakeStr(txtInDate)
.Class_Id = Val(txtClass_ID)
.Title = MakeStr(txtTitle)
dd = Date
dd = Format(dd, "yyyy-mm-dd")
t = Time
tt = Trim(Str(Hour(t))) + ":" + Trim(Str(Minute(t))) + ":" + Trim(Str(Second(t)))
.Fillin_Time = dd + " " + tt
If Modify = False Then
.Insert
Else
Call .Update(OriStudent_Id)
End If
End With
MsgBox ("数据已保存")
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
FrmStuMan.Adodc1.Refresh '窗体退出时刷新记录
End Sub
Private Sub txtBadgeID_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtStu_Name_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtFamily_Place_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtHomePhone_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtId_Card_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtMemo_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtNationality_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtResidence_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtTitle_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -