📄 frmpedit.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Begin VB.Form FrmPEdit
Caption = "添加父项"
ClientHeight = 5325
ClientLeft = 60
ClientTop = 510
ClientWidth = 5685
Icon = "FrmPEdit.frx":0000
LinkTopic = "Form1"
ScaleHeight = 5325
ScaleWidth = 5685
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 120
Top = 4560
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.ComboBox CmbName
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 2160
TabIndex = 9
Top = 1320
Width = 3375
End
Begin VB.Image Image4
Height = 300
Left = 3120
Picture = "FrmPEdit.frx":0CCA
Top = 4560
Width = 300
End
Begin VB.Label LblBack
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 = 3720
MouseIcon = "FrmPEdit.frx":10E6
MousePointer = 99 'Custom
TabIndex = 11
Top = 4560
Width = 615
End
Begin VB.Image Image3
Height = 300
Left = 1680
Picture = "FrmPEdit.frx":13F0
Top = 4560
Width = 300
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 = 2280
MouseIcon = "FrmPEdit.frx":180C
MousePointer = 99 'Custom
TabIndex = 10
Top = 4560
Width = 615
End
Begin VB.Label LblUnit
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 2160
MouseIcon = "FrmPEdit.frx":1B16
TabIndex = 8
Top = 3600
Width = 150
End
Begin VB.Label LblColor
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 2160
MouseIcon = "FrmPEdit.frx":1E20
TabIndex = 7
Top = 2880
Width = 150
End
Begin VB.Label LblSpecification
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 2160
MouseIcon = "FrmPEdit.frx":212A
TabIndex = 6
Top = 2160
Width = 150
End
Begin VB.Label LblItem
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 2160
MouseIcon = "FrmPEdit.frx":2434
TabIndex = 5
Top = 480
Width = 150
End
Begin VB.Label Label13
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "父项 名称:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 240
MouseIcon = "FrmPEdit.frx":273E
TabIndex = 4
Top = 1320
Width = 1905
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "父项 单位:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 240
MouseIcon = "FrmPEdit.frx":2A48
TabIndex = 3
Top = 3600
Width = 1905
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "父项 颜色:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 240
MouseIcon = "FrmPEdit.frx":2D52
TabIndex = 2
Top = 2880
Width = 1905
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "父项 规格:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 240
MouseIcon = "FrmPEdit.frx":305C
TabIndex = 1
Top = 2160
Width = 1905
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "父项项目号:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 300
Left = 240
MouseIcon = "FrmPEdit.frx":3366
TabIndex = 0
Top = 480
Width = 1890
End
End
Attribute VB_Name = "FrmPEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmbName_Click()
If CmbName.ListIndex <> 0 Then
'添加选择的父项信息
Adodc1.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
Adodc1.RecordSource = "select * from Item where name='" + Trim(CmbName.Text) + "' "
Adodc1.Refresh
'填充父项信息
Set LblItem.DataSource = Adodc1
LblItem.DataField = "Item"
Set LblSpecification.DataSource = Adodc1
LblSpecification.DataField = "Specification"
Set LblColor.DataSource = Adodc1
LblColor.DataField = "Color"
Set LblUnit.DataSource = Adodc1
LblUnit.DataField = "Unit"
End If
End Sub
Private Sub Form_Load()
'装入CmbName的信息
CmbName.AddItem "请选择要添加的父项"
MyBOM.Load_Parent
i = 0
Do While Arr_Item(i) <> ""
CmbName.AddItem Arr_Item(i)
i = i + 1
Loop
CmbName.ListIndex = 0
End Sub
Private Sub LblBack_Click()
Unload Me
End Sub
Private Sub LblOK_Click()
If Check = False Then
Exit Sub
End If
With MyBOM
.ParentItem = LblItem.Caption
If .In_DBP(LblItem.Caption) = True Then
MsgBox "该父项已经存在,请重新选择"
LblItem.Caption = ""
LblSpecification.Caption = ""
LblColor.Caption = ""
LblUnit.Caption = ""
CmbName.ListIndex = 0
Exit Sub
Else
.InsertP '添加
MsgBox "添加成功"
End If
End With
Unload Me
End Sub
Private Function Check() As Boolean
If LblItem.Caption = "" Then
MsgBox "请选择要添加的父项"
Check = False
Exit Function
End If
Check = True
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -