【VB开源代码栏目提醒】:网学会员为需要VB开源代码的朋友们搜集整理了FrmBuyerEdit.frm相关资料,希望对各位网友有所帮助!
VERSION 5.00
Begin VB.Form FrmBuyerEdit
Caption = "采购员信息"
ClientHeight = 3210
ClientLeft = 60
ClientTop = 510
ClientWidth = 5520
Icon = "FrmBuyerEdit.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3210
ScaleWidth = 5520
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox TxtDepartment
Height = 375
Left = 2160
TabIndex = 5
Top = 1920
Width = 2775
End
Begin VB.TextBox TxtBuyerName
Height = 375
Left = 2160
TabIndex = 4
Top = 1200
Width = 2775
End
Begin VB.TextBox TxtBuyerID
Height = 375
Left = 2160
TabIndex = 3
Top = 480
Width = 2775
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 = 1560
MouseIcon = "FrmBuyerEdit.frx":0CCA
MousePointer = 99 'Custom
TabIndex = 7
Top = 2640
Width = 735
End
Begin VB.Image Image3
Height = 300
Left = 960
Picture = "FrmBuyerEdit.frx":0FD4
Top = 2640
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 = 3960
MouseIcon = "FrmBuyerEdit.frx":13F0
MousePointer = 99 'Custom
TabIndex = 6
Top = 2640
Width = 855
End
Begin
VB.Image Image4
Height = 300
Left = 3360
Picture = "FrmBuyerEdit.frx":16FA
Top = 2640
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 = 480
MouseIcon = "FrmBuyerEdit.frx":1B16
TabIndex = 2
Top = 1920
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 = 360
MouseIcon = "FrmBuyerEdit.frx":1E20
TabIndex = 1
Top = 1200
Width = 1575
End
Begin VB.Label LblBuyerID
BackStyle = 0 'Transparent
Caption = "采购员ID"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
MouseIcon = "FrmBuyerEdit.frx":212A
TabIndex = 0
Top = 480
Width = 1335
End
End
Attribute VB_Name = "FrmBuyerEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriBuyerID As String
Private Sub LblCancel_Click()
Unload Me
End Sub
Private Function Check() As Boolean
If Trim(TxtBuyerID) = "" Then
MsgBox "请输入采购员代号"
TxtBuyerID.SetFocus
Check = False
Exit Function
End If
If Trim(TxtBuyerName) = "" Then
MsgBox "请输入采购员"
TxtBuyerName.SetFocus
Check = False
Exit Function
End If
If Trim(TxtDepartment) = "" Then
MsgBox "请输入采购员所属部门"
TxtDepartment.SetFocus
Check = False
Exit Function
End If
Check = True
End Function
Private Sub lblOk_Click()
'判断要编辑信息是否完整
If Check = False Then
Exit Sub
End If
With MyBuyer
.BuyerID = TxtBuyerID.Text
.BuyerName = TxtBuyerName.Text
.Department = TxtDepartment.Text
'判断操作是添加还是修改
If Modify = False Then '判断为添加操作
'判断采购员ID是否已经存在
If .In_DB(TxtBuyerID.Text) = True Then
MsgBox "采购员代号重复,请重新设置"
TxtBuyerID.SetFocus
TxtBuyerID.SelStart = 0
TxtBuyerID.SelLength = Len(TxtBuyerID)
Exit Sub
Else
.Insert '添加
MsgBox "添加成功"
End If
Else '判断为修改操作
.Update (OriBuyerID)
MsgBox "修改成功"
End If
End With
Unload Me
FrmBuyer.Adodc1.Refresh
End Sub