📄 frm_addgl.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form Frm_addgl
BorderStyle = 1 'Fixed Single
Caption = "添加管理人才"
ClientHeight = 4155
ClientLeft = 3495
ClientTop = 2130
ClientWidth = 5130
Icon = "Frm_addgl.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4155
ScaleWidth = 5130
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text5
Height = 735
Left = 1080
MultiLine = -1 'True
TabIndex = 21
Top = 2700
Width = 3855
End
Begin VB.TextBox Text1
Height = 270
Left = 1080
TabIndex = 10
Top = 180
Width = 1395
End
Begin VB.ComboBox Combo1
Height = 300
Left = 3600
TabIndex = 9
Top = 180
Width = 1335
End
Begin VB.ComboBox Combo2
Height = 300
Left = 3600
TabIndex = 7
Top = 600
Width = 1335
End
Begin VB.ComboBox Combo3
Height = 300
Left = 1080
TabIndex = 6
Top = 1020
Width = 1395
End
Begin VB.ComboBox Combo4
Height = 300
Left = 3600
TabIndex = 5
Top = 1020
Width = 1335
End
Begin VB.TextBox Text2
Height = 300
Left = 1080
TabIndex = 4
Top = 1440
Width = 3855
End
Begin VB.TextBox Text3
Height = 300
Left = 1080
TabIndex = 3
Top = 1860
Width = 3855
End
Begin VB.TextBox Text4
Height = 300
Left = 1080
TabIndex = 2
Top = 2340
Width = 3855
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 320
Left = 900
TabIndex = 1
Top = 3600
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 320
Left = 3060
TabIndex = 0
Top = 3600
Width = 1155
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 315
Left = 1080
TabIndex = 8
Top = 600
Width = 1395
_ExtentX = 2461
_ExtentY = 556
_Version = 393216
CustomFormat = "yyyy-MM-dd"
Format = 16711683
CurrentDate = 38804
End
Begin VB.Label Label10
Caption = "简历"
Height = 195
Left = 240
TabIndex = 20
Top = 2760
Width = 675
End
Begin VB.Label Label1
Caption = "姓 名"
Height = 255
Left = 300
TabIndex = 19
Top = 180
Width = 495
End
Begin VB.Label Label2
Caption = "性 别"
Height = 255
Left = 2760
TabIndex = 18
Top = 240
Width = 495
End
Begin VB.Label Label3
Caption = "出生日期"
Height = 195
Left = 240
TabIndex = 17
Top = 660
Width = 795
End
Begin VB.Label Label4
Caption = "文化程度"
Height = 195
Left = 2760
TabIndex = 16
Top = 660
Width = 735
End
Begin VB.Label Label5
Caption = "政治面貌"
Height = 195
Left = 240
TabIndex = 15
Top = 1080
Width = 795
End
Begin VB.Label Label6
Caption = "技术职称"
Height = 255
Left = 2760
TabIndex = 14
Top = 1080
Width = 795
End
Begin VB.Label Label7
Caption = "家庭住址"
Height = 195
Left = 240
TabIndex = 13
Top = 1500
Width = 795
End
Begin VB.Label Label8
Caption = "技术特长"
Height = 195
Left = 240
TabIndex = 12
Top = 1920
Width = 795
End
Begin VB.Label Label9
Caption = "类别"
Height = 195
Left = 240
TabIndex = 11
Top = 2340
Width = 735
End
End
Attribute VB_Name = "Frm_addgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo myerr
If Trim(Text1) = "" Then
MsgBox "姓名不能为空!", vbExclamation, "提示"
Exit Sub
End If
If Trim(Combo1) = "" Then
MsgBox "性别不能为空!", vbExclamation, "提示"
Exit Sub
End If
If Trim(Combo2) = "" Then
MsgBox "文化程度不能为空!", vbExclamation, "提示"
Exit Sub
End If
If Trim(Text1) = "" Then
MsgBox "政治面貌不能为空!", vbExclamation, "提示"
Exit Sub
End If
If Trim(Text1) = "" Then
MsgBox "技术职称不能为空!", vbExclamation, "提示"
Exit Sub
End If
If Len(Text1) > 8 Then
MsgBox "姓名超长", vbExclamation, "提示"
Text1.SetFocus
Exit Sub
End If
Dim cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Set cn = GetCn
rst.Open "select * from 管理人才数据表 where 姓名='" & Trim(Text1) & "'", cn, 0, 1
If Not (rst.BOF And rst.EOF) Then
msg = MsgBox("该姓名已存在,是否继续?", vbYesNo + vbQuestion, "提示")
If msg = vbNo Then
rst.Close
cn.Close
Exit Sub
End If
End If
cn.Execute "insert into 管理人才数据表 (姓名,性别,出生日期,文化程度,政治面貌,技术职称,家庭住址,类别,简历) values ('" & Text1 & "','" & Combo1 & "','" & DTPicker1 & "','" & Combo2 & "','" & Combo3 & "','" & Combo4 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "')"
MsgBox "保存成功!", vbExclamation, "提示"
Unload Me
Exit Sub
myerr:
MsgBox Error, vbExclamation, "提示"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Combo1.AddItem "男"
Combo1.AddItem "女"
Combo2.AddItem "高中"
Combo2.AddItem "大专"
Combo2.AddItem "大本"
Combo2.AddItem "硕士"
Combo2.AddItem "博士"
Combo3.AddItem "群众"
Combo3.AddItem "团员"
Combo3.AddItem "党员"
Combo4.AddItem "技工"
Combo4.AddItem "技术员"
Combo4.AddItem "工程师"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -