?? frmemployeeupdate.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmEmployeeUpdate
BorderStyle = 3 'Fixed Dialog
Caption = "編輯員工"
ClientHeight = 6975
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 9960
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6975
ScaleWidth = 9960
ShowInTaskbar = 0 'False
Begin VB.ComboBox cbLogon
Height = 315
Left = 5280
Style = 2 'Dropdown List
TabIndex = 12
Top = 3120
Width = 2295
End
Begin VB.CommandButton cmdOK
Caption = "確定"
Height = 375
Left = 6600
TabIndex = 6
Top = 6360
Width = 1095
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 7800
TabIndex = 5
Top = 6360
Width = 1095
End
Begin VB.TextBox txtNo
Height = 375
Left = 1920
MaxLength = 10
TabIndex = 4
Top = 1920
Width = 1455
End
Begin VB.TextBox txtName
Height = 375
Left = 5280
MaxLength = 20
TabIndex = 3
Top = 1920
Width = 2295
End
Begin VB.TextBox txtLogin
Height = 375
Left = 1920
MaxLength = 20
TabIndex = 2
Top = 2520
Width = 1455
End
Begin VB.TextBox txtDept
Height = 375
Left = 5280
MaxLength = 20
TabIndex = 1
Top = 2520
Width = 2295
End
Begin VB.TextBox txtPassword
Height = 375
IMEMode = 3 'DISABLE
Left = 1920
MaxLength = 20
PasswordChar = "*"
TabIndex = 0
Top = 3120
Width = 1455
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "系統(tǒng)用戶"
Height = 195
Left = 4440
TabIndex = 13
Top = 3120
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "員工編號(hào)"
Height = 195
Left = 1080
TabIndex = 11
Top = 1920
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "員工名稱"
Height = 195
Left = 4440
TabIndex = 10
Top = 1920
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "登錄名"
Height = 195
Left = 1080
TabIndex = 9
Top = 2520
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "部門"
Height = 195
Left = 4440
TabIndex = 8
Top = 2520
Width = 360
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "密碼"
Height = 195
Left = 1080
TabIndex = 7
Top = 3120
Width = 360
End
End
Attribute VB_Name = "frmEmployeeUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
'編輯員工
Dim sSQL As String
sSQL = "update hrEmployee set No=" + CheckString(Trim(txtNo.Text)) + _
",Name=" + CheckString(Trim(txtName.Text)) + ",LoginName=" + CheckString(Trim(txtLogin)) + _
",Password=" + CheckString(Trim(txtPassword.Text)) + ",Logon=" & CheckString(Me.cbLogon.Text) & "," & _
"Department=" + CheckString(Trim(txtDept.Text)) + ",OperatorID=" + CheckString(g_sUserID) + _
",ModifyDate=getdate() where id=" + CheckString(frmEmployee.ExcelGrid1.DataRecordset.Fields("ID").value)
g_cn.Execute sSQL
Unload Me
frmEmployee.RefreshData
End Sub
Private Sub Form_Load()
'center the form
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
'寫入數(shù)據(jù)到界面
Me.txtDept.Text = IIf(IsNull(frmEmployee.ExcelGrid1.DataRecordset.Fields("Department").value), "", frmEmployee.ExcelGrid1.DataRecordset.Fields("Department").value)
Me.txtLogin.Text = frmEmployee.ExcelGrid1.DataRecordset.Fields("Loginname").value
Me.txtName.Text = frmEmployee.ExcelGrid1.DataRecordset.Fields("name").value
Me.txtNo.Text = frmEmployee.ExcelGrid1.DataRecordset.Fields("no").value
Me.txtPassword = frmEmployee.ExcelGrid1.DataRecordset.Fields("password").value
cbLogon.AddItem "是"
cbLogon.AddItem "否"
Me.cbLogon.Text = frmEmployee.ExcelGrid1.DataRecordset.Fields("logon").value
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -