?? 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 + -