📄 transferwindows.frm
字号:
VERSION 5.00
Begin VB.Form frmTransferWindows
BorderStyle = 1 'Fixed Single
Caption = "调动至:(只需输入有变动的,没有变动的无需填写)"
ClientHeight = 1785
ClientLeft = 4440
ClientTop = 6285
ClientWidth = 6705
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1785
ScaleWidth = 6705
Begin VB.Frame Frame1
Height = 1695
Left = 120
TabIndex = 0
Top = 0
Width = 6495
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 375
Left = 5760
Picture = "TransferWindows.frx":0000
ScaleHeight = 375
ScaleWidth = 375
TabIndex = 11
Top = 360
Width = 375
End
Begin VB.CommandButton cmdCancel
Caption = "取消(&C)"
Height = 375
Left = 4800
TabIndex = 10
Top = 1080
Width = 1215
End
Begin VB.CommandButton cmdOK
Caption = "确定(&O)"
Height = 375
Left = 3480
TabIndex = 9
Top = 1080
Width = 1215
End
Begin VB.ComboBox cmbPost
Height = 300
Left = 1320
TabIndex = 8
Top = 1080
Width = 1695
End
Begin VB.ComboBox cmbPosition
Height = 300
Left = 4320
TabIndex = 6
Top = 720
Width = 1695
End
Begin VB.ComboBox cmbWorkType
Height = 300
Left = 1320
TabIndex = 4
Top = 720
Width = 1695
End
Begin VB.TextBox txtPart
Height = 270
Left = 1320
TabIndex = 2
Top = 360
Width = 4695
End
Begin VB.Label lblKey
Height = 375
Left = 4080
TabIndex = 12
Top = 1080
Width = 735
End
Begin VB.Label Label8
Caption = "新 职 称:"
Height = 255
Left = 240
TabIndex = 7
Top = 1080
Width = 1095
End
Begin VB.Label Label7
Caption = "新 职 务:"
Height = 255
Left = 3360
TabIndex = 5
Top = 720
Width = 975
End
Begin VB.Label Label6
Caption = "新 工 种:"
Height = 255
Left = 240
TabIndex = 3
Top = 720
Width = 1095
End
Begin VB.Label Label5
Caption = "新 部 门:"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 975
End
End
End
Attribute VB_Name = "frmTransferWindows"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If txtPart = "" And cmbPosition.Text = "" And cmbPost.Text = "" And cmbWorkType.Text = "" Then
MsgBox "请输入完整信息”!", vbCritical + vbOKOnly, "信息提示"
Else
Do While Not (txtPart = "" And cmbPosition.Text = "" And cmbPost.Text = "" And cmbWorkType.Text = "")
Dim strSQL As String
If txtPart <> "" Then
strSQL = "Update 人事档案 Set 部门='" + txtPart + "'"
strSQL = strSQL + " where 编号='" + lblKey.Caption + "'"
ADOcn.Execute strSQL
txtPart = ""
ElseIf cmbPosition.Text <> "" Then
strSQL = "Update 人事档案 Set 职务='" + cmbPosition.Text + "'"
strSQL = strSQL + " where 编号='" + lblKey.Caption + "'"
ADOcn.Execute strSQL
cmbPosition.Text = ""
ElseIf cmbPost.Text <> "" Then
strSQL = "Update 人事档案 Set 职称='" + cmbPost.Text + "'"
strSQL = strSQL + " where 编号='" + lblKey.Caption + "'"
ADOcn.Execute strSQL
cmbPost.Text = ""
ElseIf cmbWorkType.Text <> "" Then
strSQL = "Update 人事档案 Set 工种='" + cmbWorkType.Text + "'"
strSQL = strSQL + " where 编号='" + lblKey.Caption + "'"
ADOcn.Execute strSQL
cmbWorkType.Text = ""
End If
Loop
End If
MyRefresh_frmHumanTransfer
Unload Me
Dim adors As New Recordset
Dim strSQL1 As String
Set adors.ActiveConnection = ADOcn
Dim mystr As String
frmHumanTransfer.MSFlexGrid1.Col = 0
mystr = frmHumanTransfer.MSFlexGrid1.Text
strSQL1 = "Select * From 人事档案 Where 编号='" + mystr + "'"
adors.Open strSQL1
If Not adors.EOF Then
frmHumanTransfer.txtNum = adors("编号")
frmHumanTransfer.txtName = adors("姓名")
frmHumanTransfer.txtPart = adors("部门")
frmHumanTransfer.txtWorkType = adors("工种")
frmHumanTransfer.txtPosition = adors("职务")
frmHumanTransfer.txtPost = adors("职称")
End If
End Sub
Private Sub Form_Load()
WorkTypeAdd
PositionAdd
PostAdd
End Sub
Private Sub PositionAdd()
Dim adors As New Recordset
Dim strSQL As String
adors.ActiveConnection = ADOcn
strSQL = "Select * From 职务"
adors.Open strSQL
i = 1
Do While Not adors.EOF
frmTransferWindows.cmbPosition.AddItem (adors("职务"))
adors.MoveNext
i = i + 1
Loop
End Sub
Private Sub PostAdd()
Dim adors As New Recordset
Dim strSQL As String
adors.ActiveConnection = ADOcn
strSQL = "Select * From 职称"
adors.Open strSQL
i = 1
Do While Not adors.EOF
frmTransferWindows.cmbPost.AddItem (adors("职称"))
adors.MoveNext
i = i + 1
Loop
End Sub
Private Sub WorkTypeAdd()
Dim adors As New Recordset
Dim strSQL As String
adors.ActiveConnection = ADOcn
strSQL = "Select * From 工种"
adors.Open strSQL
i = 1
Do While Not adors.EOF
frmTransferWindows.cmbWorkType.AddItem (adors("工种"))
adors.MoveNext
i = i + 1
Loop
End Sub
Private Sub Picture1_Click()
Part = 2
frmPartmentL.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -