📄 frminputstudentinfo.frm
字号:
VERSION 5.00
Begin VB.Form frmInputStudentInfo
Caption = "学员信息编辑窗口"
ClientHeight = 4395
ClientLeft = 60
ClientTop = 345
ClientWidth = 8385
Icon = "frmInputStudentInfo.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 4395
ScaleWidth = 8385
Begin VB.ComboBox cmbWkStatus
Height = 300
Left = 4200
Style = 2 'Dropdown List
TabIndex = 10
Top = 1680
Width = 1215
End
Begin VB.TextBox txtPostCode
Height = 300
Left = 6945
TabIndex = 13
Top = 2160
Width = 1215
End
Begin VB.TextBox txtDetails
Height = 300
Left = 6945
TabIndex = 11
Top = 1680
Width = 1215
End
Begin VB.ComboBox cmbSex
Height = 300
ItemData = "frmInputStudentInfo.frx":0E42
Left = 6945
List = "frmInputStudentInfo.frx":0E44
Style = 2 'Dropdown List
TabIndex = 2
Top = 240
Width = 1215
End
Begin VB.ComboBox cmbEdu
Height = 300
Left = 6945
Style = 2 'Dropdown List
TabIndex = 8
Top = 1200
Width = 1215
End
Begin VB.ComboBox cmbCCode
Height = 300
Left = 6945
Style = 2 'Dropdown List
TabIndex = 5
Top = 720
Width = 1215
End
Begin VB.TextBox txtWkType
Height = 300
Left = 1425
TabIndex = 9
Top = 1680
Width = 1215
End
Begin VB.TextBox txtCompany
Height = 300
Left = 1425
TabIndex = 12
Top = 2160
Width = 3975
End
Begin VB.TextBox txtAddress
Height = 300
Left = 1425
TabIndex = 14
Top = 2640
Width = 6735
End
Begin VB.TextBox txtMajor
Height = 300
Left = 4185
TabIndex = 7
Top = 1200
Width = 1215
End
Begin VB.TextBox txtColleage
Height = 300
Left = 1425
TabIndex = 6
Top = 1200
Width = 1215
End
Begin VB.TextBox txtIDCard
Height = 300
Left = 1425
TabIndex = 3
Top = 720
Width = 1215
End
Begin VB.TextBox txtPinYin
Height = 300
Left = 4185
TabIndex = 1
Top = 240
Width = 1215
End
Begin VB.TextBox txtName
Height = 300
Left = 1425
TabIndex = 0
Top = 240
Width = 1215
End
Begin VB.TextBox txtSID
Height = 300
Left = 4185
TabIndex = 4
Top = 720
Width = 1215
End
Begin VB.CommandButton cmdAdd
Caption = "添加记录"
Height = 375
Left = 825
Style = 1 'Graphical
TabIndex = 19
Top = 3720
Width = 975
End
Begin VB.CommandButton cmdCancel
Caption = "放 弃"
Height = 375
Left = 1980
Style = 1 'Graphical
TabIndex = 20
Top = 3720
Width = 975
End
Begin VB.CommandButton cmdDel
Caption = "删除记录"
Height = 375
Left = 3135
Style = 1 'Graphical
TabIndex = 21
Top = 3720
Width = 975
End
Begin VB.CommandButton cmdModify
Caption = "修改记录"
Height = 375
Left = 4320
Style = 1 'Graphical
TabIndex = 22
Top = 3720
Width = 975
End
Begin VB.CommandButton cmdExit
Caption = "退 出"
Height = 375
Left = 6585
Style = 1 'Graphical
TabIndex = 25
Top = 3720
Width = 975
End
Begin VB.CommandButton cmdFirst
Caption = "<<"
Height = 255
Left = 825
Style = 1 'Graphical
TabIndex = 15
Top = 3240
Width = 1095
End
Begin VB.CommandButton cmdPrevious
Caption = "<"
Height = 255
Left = 2700
Style = 1 'Graphical
TabIndex = 16
Top = 3240
Width = 1095
End
Begin VB.CommandButton cmdNext
Caption = ">"
Height = 255
Left = 4590
Style = 1 'Graphical
TabIndex = 17
Top = 3240
Width = 1095
End
Begin VB.CommandButton cmdLast
Caption = ">>"
Height = 255
Left = 6465
Style = 1 'Graphical
TabIndex = 18
Top = 3240
Width = 1095
End
Begin VB.CommandButton cmdSave
Caption = "确 定 "
Height = 375
Left = 5430
Style = 1 'Graphical
TabIndex = 23
Top = 3720
Width = 975
End
Begin VB.Label lblWkStatus
Caption = "工作状态"
Height = 300
Left = 2985
TabIndex = 39
Top = 1680
Width = 855
End
Begin VB.Label lblPostCode
Caption = "邮政编码"
Height = 300
Left = 5760
TabIndex = 38
Top = 2160
Width = 855
End
Begin VB.Label lblWType
Caption = "工作种类"
Height = 300
Left = 225
TabIndex = 37
Top = 1680
Width = 855
End
Begin VB.Label lblDetails
Caption = "备 注"
Height = 300
Left = 5745
TabIndex = 36
Top = 1680
Width = 855
End
Begin VB.Label lblMajor
Caption = "专 业"
Height = 300
Left = 2985
TabIndex = 35
Top = 1200
Width = 855
End
Begin VB.Label lblColleage
Caption = "毕业学校"
Height = 300
Left = 225
TabIndex = 34
Top = 1200
Width = 855
End
Begin VB.Label lblEdu
Caption = "文化程度"
Height = 300
Left = 5745
TabIndex = 33
Top = 1200
Width = 855
End
Begin VB.Label lblCompany
Caption = "工作单位"
Height = 300
Left = 225
TabIndex = 32
Top = 2160
Width = 855
End
Begin VB.Label lblMailAdd
Caption = "地 址"
Height = 300
Left = 225
TabIndex = 31
Top = 2640
Width = 855
End
Begin VB.Label lblIDCard
Caption = "身份证号"
Height = 300
Left = 225
TabIndex = 30
Top = 720
Width = 855
End
Begin VB.Label lblSex
Caption = "性 别"
Height = 300
Left = 5745
TabIndex = 29
Top = 240
Width = 855
End
Begin VB.Label lblPinYin
Caption = "姓名拼音"
Height = 300
Left = 2985
TabIndex = 28
Top = 240
Width = 855
End
Begin VB.Label lblName
Caption = "姓 名"
Height = 300
Left = 225
TabIndex = 27
Top = 240
Width = 855
End
Begin VB.Label lblCCode
Caption = "中心代码"
Height = 300
Left = 5760
TabIndex = 26
Top = 720
Width = 855
End
Begin VB.Label lblSID
Caption = "学 号"
Height = 300
Left = 2985
TabIndex = 24
Top = 720
Width = 855
End
End
Attribute VB_Name = "frmInputStudentInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdAdd_Click()
cmdFlag = 1
Dim ctlcontrol As Control
'禁用除 添加记录 放弃添加 确定 退出 以外的所有按钮控件
For Each ctlcontrol In Controls
If TypeOf ctlcontrol Is CommandButton Then
If ctlcontrol.Name = "cmdAdd" Or ctlcontrol.Name = "cmdCancel" Or ctlcontrol.Name = "cmdSave" Or ctlcontrol.Name = "cmdExit" Then
ctlcontrol.Enabled = True
Else
ctlcontrol.Enabled = False
End If
End If
Next
'清除所有控件的文本显示,DisplayRefresh子程 见本窗体
DisplayRefresh
cmdCancel.SetFocus
End Sub
Private Sub cmdCancel_Click()
cmdFlag = 0
'清除所有控件的文本显示,DisplayRefresh子程 见本窗体
DisplayRefresh
'消除控件的禁用,ControlEnabled子程 见本窗体
ControlEnabled
End Sub
Private Sub cmdDel_Click()
cmdFlag = 2
'禁用 添加记录 修改记录 按钮控件
Dim ctlcontrol As Control
For Each ctlcontrol In Controls
If TypeOf ctlcontrol Is CommandButton Then
If ctlcontrol.Name = "cmdAdd" Or ctlcontrol.Name = "cmdModify" Then
ctlcontrol.Enabled = False
End If
End If
Next
'禁用控件文本框和组合框,ControlDisabled子程 见本窗体
ControlDisabled
txtIDCard.Enabled = False
cmdCancel.SetFocus
End Sub
Private Sub cmdExit_Click()
'关闭记录集,RsClose函数 见模块MdlConnection
RsClose rs
'关闭窗体
Unload Me
End Sub
Private Sub cmdFirst_Click()
rs.MoveFirst
'显示当前记录内容,Display子程 见本窗体
Display
End Sub
Private Sub cmdLast_Click()
rs.MoveLast
'显示当前记录内容,Display子程 见本窗体
Display
End Sub
Private Sub cmdModify_Click()
cmdFlag = 3
'禁用 添加记录 删除记录 按钮控件
Dim ctlcontrol As Control
For Each ctlcontrol In Controls
If TypeOf ctlcontrol Is CommandButton Then
If ctlcontrol.Name = "cmdAdd" Or ctlcontrol.Name = "cmdDel" Then
ctlcontrol.Enabled = False
End If
End If
Next
txtIDCard.Enabled = False
cmdCancel.SetFocus
End Sub
Private Sub cmdNext_Click()
With rs
.MoveNext
If .EOF Then .MoveLast
End With
'显示当前记录内容,Display子程 见本窗体
Display
End Sub
Private Sub cmdPrevious_Click()
With rs
.MovePrevious
If .BOF Then .MoveFirst
End With
'显示当前记录内容,Display子程 见本窗体
Display
End Sub
Private Sub cmdSave_Click()
Dim ctlcontrol As Control
If cmdFlag = 1 Then
'判断添加的中心代码是否已存在,存在则退出子程
Dim strTemp As String
strTemp = Trim(txtIDCard.Text)
strFind = "select * from studentinfo where idcard='" & strTemp & "'"
RsOpen rsTemp, con, strFind, "adcmdtext"
If Not (rsTemp.BOF And rsTemp.EOF) Then
MsgBox "本学员信息已经存在" & Chr(10) & "请选择修改信息! ", vbOKOnly + vbCritical, "警告"
RsClose rsTemp
Exit Sub
Else
RsClose rsTemp
End If
'验证录入项,InputVerify函数 见本窗体
If InputVerify = False Then
Exit Sub
End If
'添加一行记录
With rs
.AddNew
rs![sname] = Trim(txtName.Text)
rs![pinyin] = Trim(txtPinYin.Text)
rs![sex] = Trim(cmbSex.Text)
rs![sid] = Trim(txtSID.Text)
rs![ccode] = Trim(cmbCCode.Text)
If Trim(txtColleage.Text) = "" Then
rs![colleage] = "无"
Else
rs![colleage] = Trim(txtColleage.Text)
End If
If Trim(txtMajor.Text) = "" Then
rs![Major] = "无"
Else
rs![Major] = Trim(txtMajor.Text)
End If
rs![education] = cmbEdu.Text
If Trim(txtWkType.Text) = "" Then
rs![wktype] = "无"
Else
rs![wktype] = Trim(txtWkType.Text)
End If
rs![wkstatus] = Trim(cmbWkStatus.Text)
rs![idcard] = Trim(txtIDCard.Text)
If Trim(txtCompany.Text) = "" Then
rs![company] = "无"
Else
rs![company] = Trim(txtCompany.Text)
End If
If Trim(txtDetails.Text) = "" Then
rs![details] = "无"
Else
rs![details] = Trim(txtDetails.Text)
End If
If Trim(txtAddress.Text) = "" Then
rs![mailadd] = "无"
Else
rs![mailadd] = Trim(txtAddress.Text)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -