?? frmusersedit.frm
字號:
VERSION 5.00
Begin VB.Form FrmUsersEdit
BorderStyle = 1 'Fixed Single
Caption = "系統用戶信息"
ClientHeight = 3165
ClientLeft = 45
ClientTop = 495
ClientWidth = 7410
Icon = "FrmUsersEdit.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3165
ScaleWidth = 7410
StartUpPosition = 2 '屏幕中心
Begin VB.ListBox List1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1950
ItemData = "FrmUsersEdit.frx":0CCA
Left = 4440
List = "FrmUsersEdit.frx":0CE3
Style = 1 'Checkbox
TabIndex = 9
Top = 600
Width = 2535
End
Begin VB.Frame Frame1
Caption = "權限設定"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2535
Left = 4320
TabIndex = 8
Top = 240
Width = 2775
End
Begin VB.TextBox TxtPassword2
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 5
Top = 1800
Width = 2295
End
Begin VB.TextBox TxtPassword
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 4
Top = 1080
Width = 2295
End
Begin VB.TextBox TxtName
Height = 375
Left = 1680
TabIndex = 3
Top = 360
Width = 2295
End
Begin VB.Label LblOK
BackStyle = 0 'Transparent
Caption = "確 定"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1080
MouseIcon = "FrmUsersEdit.frx":0D57
MousePointer = 99 'Custom
TabIndex = 7
Top = 2520
Width = 735
End
Begin VB.Image Image3
Height = 300
Left = 480
Picture = "FrmUsersEdit.frx":1061
Top = 2520
Width = 300
End
Begin VB.Label LblCancel
BackStyle = 0 'Transparent
Caption = "取 消"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3000
MouseIcon = "FrmUsersEdit.frx":147D
MousePointer = 99 'Custom
TabIndex = 6
Top = 2520
Width = 855
End
Begin VB.Image Image4
Height = 300
Left = 2400
Picture = "FrmUsersEdit.frx":1787
Top = 2520
Width = 300
End
Begin VB.Label LblDepartment
BackStyle = 0 'Transparent
Caption = "確認密碼"
BeginProperty Font
Name = "宋體"
Size = 15
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
MouseIcon = "FrmUsersEdit.frx":1BA3
TabIndex = 2
Top = 1800
Width = 1335
End
Begin VB.Label LblSalesmanName
BackStyle = 0 'Transparent
Caption = "密 碼"
BeginProperty Font
Name = "宋體"
Size = 15
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
MouseIcon = "FrmUsersEdit.frx":1EAD
TabIndex = 1
Top = 1080
Width = 1335
End
Begin VB.Label LblBuyerID
BackStyle = 0 'Transparent
Caption = "用 戶 名"
BeginProperty Font
Name = "宋體"
Size = 15
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
MouseIcon = "FrmUsersEdit.frx":21B7
TabIndex = 0
Top = 360
Width = 1335
End
End
Attribute VB_Name = "FrmUsersEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriName As String
Private Sub LblCancel_Click()
Unload Me
End Sub
Private Function Check() As Boolean
If Trim(TxtName) = "" Then
MsgBox "請輸入用戶名"
TxtName.SetFocus
Check = False
Exit Function
End If
If Trim(TxtPassword) = "" Then
MsgBox "請輸入密碼"
TxtPassword.SetFocus
Check = False
Exit Function
End If
If Trim(TxtPassword2) = "" Then
MsgBox "請輸入確認密碼"
TxtPassword2.SetFocus
Check = False
Exit Function
End If
If Trim(TxtPassword2) <> Trim(TxtPassword) Then
MsgBox "兩次輸入密碼不合,請重新輸入"
TxtPassword.Text = ""
TxtPassword2.Text = ""
TxtPassword.SetFocus
Check = False
Exit Function
End If
If Len(Trim(TxtPassword2)) < 6 Then
MsgBox "密碼小于6位,請重新設置"
TxtPassword.Text = ""
TxtPassword2.Text = ""
TxtPassword.SetFocus
Check = False
Exit Function
End If
Check = True
End Function
Private Sub LblOK_Click()
'判斷要編輯信息是否完整
If Check = False Then
Exit Sub
End If
With MyUsers
.Name = TxtName.Text
.Password = TxtPassword.Text
If List1.Selected(1) = True Then
.EngineerUse = "有權限"
Else
.EngineerUse = "無權限"
End If
If List1.Selected(2) = True Then
.PurchaseUse = "有權限"
Else
.PurchaseUse = "無權限"
End If
If List1.Selected(3) = True Then
.SalesUse = "有權限"
Else
.SalesUse = "無權限"
End If
If List1.Selected(4) = True Then
.StocksUse = "有權限"
Else
.StocksUse = "無權限"
End If
If List1.Selected(5) = True Then
.ManpowerUse = "有權限"
Else
.ManpowerUse = "無權限"
End If
If List1.Selected(6) = True Then
.ClientUse = "有權限"
Else
.ClientUse = "無權限"
End If
If List1.Selected(0) = True Then
.ManageUse = "有權限"
Else
.ManageUse = "無權限"
End If
'判斷操作是添加還是修改
If Modify = False Then '判斷為添加操作
'判斷采購員ID是否已經存在
If .In_DB(TxtName.Text) = True Then
MsgBox "用戶名已存在,請重新設置"
TxtName.SetFocus
TxtName.SelStart = 0
TxtName.SelLength = Len(TxtName)
Exit Sub
Else
.Insert '添加
MsgBox "添加成功"
End If
Else '判斷為修改操作
.Update (OriName)
MsgBox "修改成功"
End If
End With
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -