?? frmbom.frm
字號:
TabIndex = 14
Top = 480
Width = 735
End
Begin VB.Label Label10
Caption = "單位:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 11040
TabIndex = 13
Top = 480
Width = 855
End
Begin VB.Label Label9
Caption = "顏色:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 8880
TabIndex = 12
Top = 480
Width = 855
End
Begin VB.Label Label7
Caption = "規格:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 6120
TabIndex = 11
Top = 480
Width = 855
End
Begin VB.Label Label5
Caption = "名稱:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3240
TabIndex = 10
Top = 480
Width = 735
End
Begin VB.Label Label3
Caption = "貨號"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 9
Top = 480
Width = 615
End
End
Begin VB.Frame Frame2
Caption = "子項"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 6015
Left = 600
TabIndex = 17
Top = 2400
Width = 13935
End
Begin VB.Label LblAdd
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 = 5520
MouseIcon = "FrmBOM.frx":14C6
MousePointer = 99 'Custom
TabIndex = 3
Top = 8640
Width = 615
End
Begin VB.Image Image5
Height = 300
Left = 4920
Picture = "FrmBOM.frx":17D0
Top = 8640
Width = 300
End
Begin VB.Label LblModify
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 = 7080
MouseIcon = "FrmBOM.frx":1BEC
MousePointer = 99 'Custom
TabIndex = 4
Top = 8640
Width = 615
End
Begin VB.Image Image2
Height = 300
Left = 6480
Picture = "FrmBOM.frx":1EF6
Top = 8640
Width = 300
End
Begin VB.Label LblDelete
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 = 8520
MouseIcon = "FrmBOM.frx":2312
MousePointer = 99 'Custom
TabIndex = 5
Top = 8640
Width = 615
End
Begin VB.Image Image3
Height = 300
Left = 7920
Picture = "FrmBOM.frx":261C
Top = 8640
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 = 9960
MouseIcon = "FrmBOM.frx":2A38
MousePointer = 99 'Custom
TabIndex = 6
Top = 8640
Width = 615
End
Begin VB.Image Image4
Left = 9360
Picture = "FrmBOM.frx":2D42
Top = 8640
Width = 300
End
Begin VB.Label LblFind
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 = 7080
MouseIcon = "FrmBOM.frx":315E
MousePointer = 99 'Custom
TabIndex = 2
Top = 2040
Width = 1095
End
Begin VB.Image Image1
Height = 300
Left = 6480
Picture = "FrmBOM.frx":3468
Top = 2040
Width = 300
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "BOM"
BeginProperty Font
Name = "宋體"
Size = 18
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6960
TabIndex = 0
Top = 240
Width = 615
End
End
Attribute VB_Name = "FrmBOM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub Refresh_BOM()
FrmBOM.TxtFather.Text = ""
FrmBOM.LblName.Caption = ""
FrmBOM.LblColor.Caption = ""
FrmBOM.LblSize.Caption = ""
FrmBOM.LblUnit.Caption = ""
FrmBOM.Adodc1.Refresh
FrmBOM.Adodc2.Refresh
End Sub
Private Sub Form_Load()
LblModify.Enabled = False
LblDelete.Enabled = False
End Sub
Private Sub ImgItem_Click()
FrmItemPQury.OK = 1
FrmItemPQury.Show 1
End Sub
Private Sub LblAdd_Click()
FrmBOMInsertLogIn.Show
End Sub
Private Sub LblBack_Click()
Unload Me
End Sub
Private Sub LblDelete_Click()
If TxtFather <> "" Then
'查詢父項信息
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "沒有該父項可進行刪除"
Exit Sub
Else
FrmBOMDeleteLogIn.LblDeleteP.Caption = "刪除父項“" + Adodc1.Recordset.Fields(4) + "”"
FrmBOMDeleteLogIn.OriParentItem = Adodc1.Recordset.Fields(0)
End If
'查詢對應子項信息
If Adodc2.Recordset.RecordCount = 0 Then
FrmBOMDeleteLogIn.LbDeletelC.Visible = False
FrmBOMDeleteLogIn.Image1.Visible = False
Else
FrmBOMDeleteLogIn.LbDeletelC.Caption = "刪除父項“" + Adodc1.Recordset.Fields(4) + "”中的子項“" + Adodc2.Recordset.Fields(11) + "”"
FrmBOMDeleteLogIn.OriChildItem = Adodc2.Recordset.Fields(2)
End If
FrmBOMDeleteLogIn.Show
Else
MsgBox "請選擇父項后指定要刪除的子項紀錄"
TxtFather.Text = ""
LblName.Caption = ""
Exit Sub
End If
End Sub
Private Sub LblFind_Click()
If LblFind.Caption = "查詢子項" Then
If TxtFather.Text = "" Then
MsgBox "請輸入要查詢的父項貨號"
TxtFather.SetFocus
Exit Sub
End If
'查詢父項信息
Adodc1.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
Adodc1.RecordSource = "select * from Parent,Item where Item.Item=Parent.ParentItem and Parent.ParentItem='" + Trim(TxtFather.Text) + "' "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
LblDelete.Enabled = False
MsgBox "該項目不是父項,請重新輸入"
TxtFather.SetFocus
TxtFather.SelStart = 0
TxtFather.SelLength = Len(TxtFather)
Else
'填充父項信息
Set TxtFather.DataSource = Adodc1
TxtFather.DataField = "Item"
Set LblName.DataSource = Adodc1
LblName.DataField = "Name"
Set LblSize.DataSource = Adodc1
LblSize.DataField = "Specification"
Set LblColor.DataSource = Adodc1
LblColor.DataField = "Color"
Set LblUnit.DataSource = Adodc1
LblUnit.DataField = "Unit"
LblDelete.Enabled = True
'使得貨號,名稱不可更改
TxtFather.Enabled = False
ImgItem.Enabled = False
LblFind.Caption = "重新查找"
End If
'查詢對應子項信息
Adodc2.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
Adodc2.RecordSource = "select * from Child,Item where Item.Item=Child.ChildItem and Child.ParentItem='" + Trim(TxtFather.Text) + "' "
Adodc2.Refresh
'填充子項信息
Set DataGrid1.DataSource = Adodc2
If Adodc2.Recordset.RecordCount <> 0 Then
LblModify.Enabled = True
Else
LblModify.Enabled = False
End If
Else
Unload Me
Me.Show
End If
End Sub
Private Sub LblModify_Click()
FrmCEdit.Modify = True
FrmCEdit.OriParentItem = Adodc1.Recordset.Fields(0)
FrmCEdit.OriChildItem = Adodc2.Recordset.Fields(2)
'父項信息
FrmCEdit.LblPName.Caption = Adodc1.Recordset.Fields(4)
FrmCEdit.LblPItem.Caption = Adodc1.Recordset.Fields(0)
FrmCEdit.LblPSpecification.Caption = Adodc1.Recordset.Fields(5)
FrmCEdit.LblPColor.Caption = Adodc1.Recordset.Fields(6)
FrmCEdit.LblPUnit.Caption = Adodc1.Recordset.Fields(7)
'子項信息
FrmCEdit.LblCName.Caption = Adodc2.Recordset.Fields(11)
FrmCEdit.LblCItem.Caption = Adodc2.Recordset.Fields(2)
FrmCEdit.LblCSpecification.Caption = Adodc2.Recordset.Fields(12)
FrmCEdit.LblCColor.Caption = Adodc2.Recordset.Fields(13)
FrmCEdit.LblCUnit.Caption = Adodc2.Recordset.Fields(14)
FrmCEdit.LblCDrawing.Caption = Adodc2.Recordset.Fields(10)
FrmCEdit.TxtQty.Text = Adodc2.Recordset.Fields(3)
FrmCEdit.CmbQT.Text = Adodc2.Recordset.Fields(4)
FrmCEdit.CmbCT.Text = Adodc2.Recordset.Fields(1)
FrmCEdit.TxtScrap.Text = Adodc2.Recordset.Fields(5)
FrmCEdit.TxtOffset.Text = Adodc2.Recordset.Fields(6)
FrmCEdit.TxtRemark.Text = Adodc2.Recordset.Fields(7)
FrmCEdit.Show
Adodc2.Refresh
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -