📄 frmempdata.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmEmpData
BorderStyle = 1 'Fixed Single
Caption = "Update Employee"
ClientHeight = 5175
ClientLeft = 45
ClientTop = 435
ClientWidth = 6480
BeginProperty Font
Name = "Century Gothic"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmEmpData.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5175
ScaleWidth = 6480
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox data
Alignment = 2 'Center
BackColor = &H00FFC0C0&
Height = 375
IMEMode = 3 'DISABLE
Index = 6
Left = 1680
PasswordChar = "*"
TabIndex = 12
Top = 3000
Width = 4215
End
Begin VB.TextBox data
Alignment = 2 'Center
BackColor = &H00FFC0C0&
Height = 375
IMEMode = 3 'DISABLE
Index = 5
Left = 1680
TabIndex = 9
Top = 2520
Width = 4215
End
Begin VB.TextBox data
Alignment = 2 'Center
BackColor = &H00FFC0C0&
Height = 375
Index = 4
Left = 1680
TabIndex = 8
Top = 2040
Width = 4215
End
Begin MSComctlLib.ImageList ImageList1
Left = 480
Top = 4200
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmEmpData.frx":0BC2
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmEmpData.frx":1014
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Height = 570
Left = 2280
TabIndex = 7
Top = 4080
Width = 2550
_ExtentX = 4498
_ExtentY = 1005
ButtonWidth = 2064
ButtonHeight = 1005
Appearance = 1
Style = 1
TextAlignment = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 3
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Cancel"
Key = "Cancel"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Update"
Key = "Save"
ImageIndex = 2
EndProperty
EndProperty
End
Begin VB.TextBox data
Alignment = 2 'Center
BackColor = &H00FFC0C0&
Height = 375
Index = 3
Left = 1680
TabIndex = 6
Top = 1560
Width = 4215
End
Begin VB.TextBox data
Alignment = 2 'Center
BackColor = &H00FFC0C0&
Height = 375
Index = 2
Left = 1680
TabIndex = 5
Top = 1080
Width = 4215
End
Begin VB.TextBox data
Alignment = 2 'Center
BackColor = &H00FFC0C0&
Height = 375
Index = 1
Left = 1680
TabIndex = 4
Top = 600
Width = 4215
End
Begin VB.TextBox data
Alignment = 2 'Center
Height = 375
Index = 0
Left = 360
TabIndex = 3
Top = 5280
Width = 1455
End
Begin VB.Label Label6
Caption = "Position"
Height = 255
Left = 480
TabIndex = 13
Top = 2040
Width = 1455
End
Begin VB.Label Label5
Caption = "Password"
Height = 255
Left = 480
TabIndex = 11
Top = 3000
Width = 1455
End
Begin VB.Label Label4
Caption = "User Name"
Height = 255
Index = 0
Left = 480
TabIndex = 10
Top = 2520
Width = 1455
End
Begin VB.Label Label3
Caption = "Address"
Height = 255
Left = 480
TabIndex = 2
Top = 1080
Width = 1455
End
Begin VB.Label Label2
Caption = "Contact No."
Height = 255
Left = 480
TabIndex = 1
Top = 1560
Width = 1455
End
Begin VB.Label Label1
Caption = "Name"
Height = 255
Left = 480
TabIndex = 0
Top = 600
Width = 1455
End
Begin VB.Shape Shape1
BackColor = &H8000000F&
BackStyle = 1 'Opaque
BorderColor = &H00FF8080&
BorderWidth = 7
Height = 4695
Left = 240
Top = 240
Width = 6015
End
End
Attribute VB_Name = "frmEmpData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim e As Integer
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.key
Case "Cancel"
Unload Me
Case "Save"
e = 1
If data(3) <> "" Then
If Not IsNumeric(data(3).Text) Then
MsgBox "The contact number you entered is invalid!"
Exit Sub
End If
End If
If data(1) = "" Then
MsgBox "Please enter your name..."
data(1).SetFocus
Exit Sub
ElseIf data(2) = "" Then
MsgBox "Please enter your address..."
Exit Sub
ElseIf data(4) = "" Then
MsgBox "Please enter your position..."
Exit Sub
ElseIf data(5) = "" Then
MsgBox "Please enter your user name..."
Exit Sub
ElseIf data(6) = "" Then
MsgBox "Please enter your password..."
Exit Sub
End If
'==============
If frmEmployee.ronberg = "add" Then
check_RStemp
rstemp.Open "select * from user_employee", Cnn
'==============
While rstemp.RecordCount > 0
check_RStemp
e = e + 1
rstemp.Open "select * from user_employee where employee_id = " & e, Cnn
Wend
Cnn.Execute "insert into user_employee values (" & e & ",'" & data(1) & "'," & _
data(2) & "," & data(3) & "," & data(4) & "," & data(5) & ",'" & data(6) & "')"
ElseIf frmEmployee.ronberg = "edit" Then
Cnn.Execute "update user_employee set name = '" & _
data(1) & "', address = " & data(2) & ", contact_no =" & data(3) & ", position = " & _
data(4) & ", user_name = " & data(5) & ", password = '" & data(6) & "' " & " where employee_id = " & data(0)
End If
rs.Requery 1
frmEmployee.fill
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -