📄 frm_kcgl_scll.frm
字号:
End
Begin VB.Label Label11
Caption = "产品编号"
Height = 195
Left = 90
TabIndex = 20
Top = 690
Width = 795
End
Begin VB.Label Label10
Caption = "物料数量/单位产品"
Height = 180
Left = 60
TabIndex = 19
Top = 1740
Width = 1635
End
Begin VB.Label Label8
Caption = "物料单位"
Height = 180
Left = 5190
TabIndex = 11
Top = 1395
Width = 810
End
Begin VB.Label Label7
Caption = "物料规格"
Height = 210
Left = 3210
TabIndex = 10
Top = 1410
Width = 780
End
Begin VB.Label Label6
Caption = "物料名称"
Height = 195
Left = 75
TabIndex = 9
Top = 1395
Width = 825
End
Begin VB.Label Label5
Caption = "物料编号"
Height = 195
Left = 5220
TabIndex = 8
Top = 1050
Width = 735
End
Begin VB.Label Label4
Caption = "产品单位"
Height = 195
Left = 75
TabIndex = 7
Top = 1035
Width = 765
End
Begin VB.Label Label3
Caption = "产品规格"
Height = 180
Left = 5205
TabIndex = 6
Top = 720
Width = 795
End
Begin VB.Label Label2
Caption = "生产计划单"
Height = 210
Left = 3735
TabIndex = 5
Top = 330
Width = 960
End
Begin VB.Label Label1
Caption = "领料单编号 "
Height = 195
Left = 75
TabIndex = 3
Top = 345
Width = 1125
End
End
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 705
Left = 0
TabIndex = 0
Top = 0
Width = 7980
_ExtentX = 14076
_ExtentY = 1244
ButtonWidth = 1138
ButtonHeight = 1191
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 13
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 增加 "
Key = "add"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "modify"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "delete"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保存"
Key = "save"
ImageIndex = 4
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "取消"
Key = "cancel"
ImageIndex = 5
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "查找"
Key = "find"
ImageIndex = 6
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "第一条"
Key = "first"
ImageIndex = 7
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "上一条"
Key = "previous"
ImageIndex = 8
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "下一条"
Key = "next"
ImageIndex = 9
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "末一条"
Key = "last"
ImageIndex = 10
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Style = 3
EndProperty
BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "关闭"
Key = "close"
ImageIndex = 11
EndProperty
EndProperty
BorderStyle = 1
End
Begin MSComctlLib.ImageList ImageList1
Left = -240
Top = 675
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 26
ImageHeight = 26
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 11
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":003D
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":1697
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":2CF1
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":434B
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":59A5
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":6FFF
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":8659
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":9CB3
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":B30D
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":C967
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Kcgl_Scll.frx":DFC1
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "Frm_Kcgl_Scll"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer, Myval As Integer '定义整型变量
Public blnadd1 As Boolean
Dim Mystr As String '定义字符变量存储编号信息
Dim rs3 As New ADODB.Recordset
Dim rs4 As New ADODB.Recordset
Dim rs5 As New ADODB.Recordset
Dim rs6 As New ADODB.Recordset
Dim rs7 As New ADODB.Recordset
Dim Myrs As New ADODB.Recordset
Dim SL As Integer '存储产品数量信息
Dim SL1 As Integer '存储产品数量信息
Dim Str1 As String '存储生产计划开始日期
Dim Str2 As String '存储物料计划截止日期
Sub view_data() '定义显示数据的过程
If Adodc1.Recordset.RecordCount > 0 Then
With Dgr_Scll
If .Columns(0) <> "" Then Text1(0).Text = .Columns(0) Else Text1(0).Text = ""
If .Columns(1) <> "" Then Cbx_Scjhd.Text = .Columns(1) Else Cbx_Scjhd.Text = ""
If .Columns(2) <> "" Then Text1(1).Text = .Columns(2) Else Text1(1).Text = ""
If .Columns(3) <> "" Then Text1(2).Text = .Columns(3) Else Text1(2).Text = ""
If .Columns(4) <> "" Then Text1(3).Text = .Columns(4) Else Text1(3).Text = ""
If .Columns(5) <> "" Then Text1(4).Text = .Columns(5) Else Text1(4).Text = ""
If .Columns(6) <> "" Then Text1(5).Text = .Columns(6) Else Text1(5).Text = ""
If .Columns(7) <> "" Then Cbx_Wlbh.Text = .Columns(7) Else Dtp_Wgrq.Value = ""
If .Columns(8) <> "" Then Text1(6).Text = .Columns(8) Else Text1(6).Text = ""
If .Columns(9) <> "" Then Text1(7).Text = .Columns(9) Else Text1(7).Text = ""
If .Columns(10) <> "" Then Text1(8).Text = .Columns(10) Else Text1(8).Text = ""
If .Columns(11) <> "" Then Text1(9).Text = .Columns(11) Else Text1(9).Text = ""
If .Columns(12) <> "" Then Text1(10).Text = .Columns(12) Else Text1(10).Text = ""
If .Columns(13) <> "" Then Text1(11).Text = .Columns(13) Else Text1(11).Text = ""
If .Columns(14) <> "" Then Text1(12).Text = .Columns(14) Else Text1(12).Text = ""
If .Columns(15) <> "" Then Text1(13).Text = .Columns(15) Else Text1(13).Text = ""
If .Columns(16) <> "" Then Dtp_llrq.Value = .Columns(16) Else Dtp_llrq = Date
If .Columns(17) <> "" Then Text1(14).Text = .Columns(17) Else Text1(14).Text = ""
End With
End If
End Sub
Private Sub Cbx_Scjhd_Change()
rs3.Open "select * from tb_SCGL_scjhd where scjhd_id='" + Cbx_Scjhd.Text + "'", cnn, adOpenKeyset
If rs3.RecordCount > 0 Then
Text1(1).Text = rs3.Fields("scjhd_cpbh")
Text1(2).Text = rs3.Fields("scjhd_cpmc")
Text1(3).Text = rs3.Fields("scjhd_cpgg")
Text1(4).Text = rs3.Fields("scjhd_jldw")
Text1(5).Text = rs3.Fields("scjhd_jhsl")
rs4.Open "select * from tb_SCGL_wlxx where wlxx_cpbh='" + rs3.Fields("scjhd_cpbh") + "'", cnn, adOpenKeyset
If rs4.RecordCount > 0 Then
Cbx_Wlbh.Clear
For i = 0 To rs4.RecordCount - 1
Cbx_Wlbh.AddItem Trim(rs4.Fields("wlxx_id"))
rs4.MoveNext
Next i
Cbx_Wlbh.ListIndex = 0
Else
Cbx_Wlbh.Clear
MsgBox "该产品没有相应的物料信息!", , "信息提示"
Exit Sub
End If
rs4.Close
End If
rs3.Close
End Sub
Private Sub Cbx_Scjhd_Click()
rs3.Open "select * from tb_SCGL_scjhd where scjhd_id='" + Cbx_Scjhd.Text + "'", cnn, adOpenKeyset
If rs3.RecordCount > 0 Then
Text1(1).Text = rs3.Fields("scjhd_cpbh")
Text1(2).Text = rs3.Fields("scjhd_cpmc")
Text1(3).Text = rs3.Fields("scjhd_cpgg")
Text1(4).Text = rs3.Fields("scjhd_jldw")
Text1(5).Text = rs3.Fields("scjhd_jhsl")
rs4.Open "select * from tb_SCGL_wlxx where wlxx_cpbh='" + rs3.Fields("scjhd_cpbh") + "'", cnn, adOpenKeyset
If rs4.RecordCount > 0 Then
Cbx_Wlbh.Clear
For i = 0 To rs4.RecordCount - 1
Cbx_Wlbh.AddItem Trim(rs4.Fields("wlxx_id"))
rs4.MoveNext
Next i
Cbx_Wlbh.ListIndex = 0
Else
Cbx_Wlbh.Clear
MsgBox "该产品没有相应的物料信息!", , "信息提示"
Exit Sub
End If
rs4.Close
End If
rs3.Close
End Sub
Private Sub Cbx_Scjhd_GotFocus()
Cbx_Scjhd.BackColor = &HFFFF80
End Sub
Private Sub Cbx_Scjhd_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text1(1).SetFocus
End Sub
Private Sub Cbx_Scjhd_LostFocus()
Cbx_Scjhd.BackColor = &HFFFFFF '设置背景色
'查询相应的计划单信息
rs3.Open "select * from tb_SCGL_scjhd where scjhd_id='" + Cbx_Scjhd.Text + "'", cnn, adOpenKeyset
If rs3.RecordCount > 0 Then '如果记录大于零
'设置相应文本框中的内容
Text1(1).Text = rs3.Fields("scjhd_cpbh")
Text1(2).Text = rs3.Fields("scjhd_cpmc")
Text1(3).Text = rs3.Fields("scjhd_cpgg")
Text1(4).Text = rs3.Fields("scjhd_jldw")
Text1(5).Text = rs3.Fields("scjhd_jhsl")
rs4.Open "select * from tb_SCGL_wlxx where wlxx_cpbh='" + rs3.Fields("scjhd_cpbh") + "'", cnn, adOpenKeyset
If rs4.RecordCount > 0 Then
Cbx_Wlbh.Clear '清除物料组合框中的内容
For i = 0 To rs4.RecordCount - 1
'向物料文本框中添加数据项
Cbx_Wlbh.AddItem Trim(rs4.Fields("wlxx_id"))
rs4.MoveNext
Next i
Cbx_Wlbh.ListIndex = 0
Else
Cbx_Wlbh.Clear
MsgBox "该产品没有相应的物料信息!", , "信息提示"
Exit Sub
End If
rs4.Close
End If
rs3.Close
'查询计划单表中是否有该计划单
Myrs.Open "select * from tb_SCGL_scjhd where scjhd_id='" + Cbx_Scjhd.Text + "'", cnn, adOpenKeyset
If Myrs.RecordCount <= 0 Then
MsgBox "请在下拉列表中选择正确的生产计划单!", , "信息提示"
Cbx_Scjhd.ListIndex = 0
Cbx_Scjhd.SetFocus
Myrs.Close
Exit Sub
End If
Myrs.Close
End Sub
Private Sub Cbx_wlbh_Click()
rs6.Open "select * from tb_SCGL_wlxx where wlxx_id='" + Cbx_Wlbh.Text + "'", cnn, adOpenKeyset
If rs6.RecordCount > 0 Then
Text1(6).Text = rs6.Fields("wlxx_wlmc")
Text1(7).Text = rs6.Fields("wlxx_wlgg")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -