📄 frmempedit.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form frmEmpEdit
BorderStyle = 1 'Fixed Single
Caption = "职工信息编辑"
ClientHeight = 2955
ClientLeft = 45
ClientTop = 375
ClientWidth = 6075
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2955
ScaleWidth = 6075
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
Height = 375
Left = 3480
TabIndex = 10
Top = 2400
Width = 1215
End
Begin VB.CommandButton Cmd_Ok
Caption = "确定"
Height = 375
Left = 1380
TabIndex = 9
Top = 2400
Width = 1155
End
Begin MSAdodcLib.Adodc AdoTitle
Height = 375
Left = 4020
Top = 2340
Visible = 0 'False
Width = 1875
_ExtentX = 3307
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc AdoDepName
Height = 375
Left = 360
Top = 2340
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame1
Height = 1875
Left = 480
TabIndex = 0
Top = 240
Width = 5175
Begin VB.ComboBox cmb_Sex
Height = 300
Left = 3420
TabIndex = 8
Text = "cmd_Sex"
Top = 420
Width = 1335
End
Begin MSDataListLib.DataCombo dco_Title
Height = 330
Left = 3420
TabIndex = 7
Top = 1260
Width = 1395
_ExtentX = 2461
_ExtentY = 582
_Version = 393216
Text = ""
End
Begin MSDataListLib.DataCombo dco_DepName
Height = 330
Left = 1260
TabIndex = 6
Top = 1260
Width = 1395
_ExtentX = 2461
_ExtentY = 582
_Version = 393216
Text = ""
End
Begin VB.TextBox txtName
Height = 315
Left = 1260
TabIndex = 5
Top = 420
Width = 1335
End
Begin VB.Label Label5
Caption = "所在部门"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 180
TabIndex = 4
Top = 1320
Width = 855
End
Begin VB.Label Label4
Caption = "性别"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2880
TabIndex = 3
Top = 480
Width = 555
End
Begin VB.Label Label3
Caption = "职务"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2880
TabIndex = 2
Top = 1320
Width = 675
End
Begin VB.Label Label1
Caption = "职工姓名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 180
TabIndex = 1
Top = 480
Width = 855
End
End
End
Attribute VB_Name = "frmEmpEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriEmpId As Long '职工编号
Private Sub Cmd_OK_Click()
If Check = False Then
Exit Sub
End If
'保存职工信息
With MyEmp
.EmpName = MakeStr(txtName)
.Sex = MakeStr(cmb_Sex.Text)
.DepName = MakeStr(dco_DepName.Text)
.ETitle = MakeStr(dco_Title.Text)
If Modify = False Then
.Insert
Else
.Update (OriEmpId)
End If
End With
MsgBox "编辑成功"
Unload Me
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Form_Load()
DataLoad '装入部门名称和职务名称
End Sub
Private Sub DataLoad()
'载入性别信息
cmb_Sex.AddItem "男", 0
cmb_Sex.AddItem "女", 1
'读取部门名称数据
AdoDepName.ConnectionString = Conn
AdoDepName.RecordSource = "SELECT Distinct DepName FROM Employees Order By DepName"
AdoDepName.Refresh
Set dco_DepName.RowSource = AdoDepName
dco_DepName.ListField = "DepName"
'读取职务名称数据
AdoTitle.ConnectionString = Conn
AdoTitle.RecordSource = "SELECT Distinct ETitle FROM Employees Order By ETitle"
AdoTitle.Refresh
Set dco_Title.RowSource = AdoTitle
dco_Title.ListField = "ETitle"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -