📄 frm_specbill_view.frm
字号:
If IsNull(Rs_Area!地区编码) = False Then Me.txt_M_Fields(0).text = Rs_Area!地区编码
If IsNull(Rs_Area!地区名称) = False Then Me.txt_M_Fields(1).text = Rs_Area!地区名称
If IsNull(Rs_Area!客户编码) = False Then Me.txt_M_Fields(2).text = Rs_Area!客户编码
If IsNull(Rs_Area!客户名称) = False Then Me.txt_M_Fields(3).text = Rs_Area!客户名称
End If
Rs_Area.Close
Cn_Area.Close
Me.txt_M_Fields(0).Enabled = False
Me.txt_M_Fields(1).Enabled = False
Me.txt_M_Fields(2).Enabled = False
Me.txt_M_Fields(3).Enabled = False
Me.txt_M_Fields(6).Enabled = False
' Me.txt_M_Fields(10).Enabled = False
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub Customer_Riches_info()
On Error GoTo err
'节目下单时其他要求
If IsNull(Rs_SpecBill!规格单号) = False Then Me.txt_Fields(0).text = Rs_SpecBill!规格单号
If IsNull(Rs_SpecBill!客户名称) = False Then Me.txt_Fields(1).text = Rs_SpecBill!客户名称
If IsNull(Rs_SpecBill!箱面标识) = False Then Me.txt_Fields(2).text = Rs_SpecBill!箱面标识
If IsNull(Rs_SpecBill!箱号) = False Then Me.txt_Fields(3).text = Rs_SpecBill!箱号
If IsNull(Rs_SpecBill!合同号) = False Then Me.txt_Fields(4).text = Rs_SpecBill!合同号
If IsNull(Rs_SpecBill!备注) = False Then Me.txt_Fields(5).text = Rs_SpecBill!备注
If IsNull(Rs_SpecBill!产品技术要求) = False Then Me.txt_Fields(6).text = Rs_SpecBill!产品技术要求
If IsNull(Rs_SpecBill!产品发货要求) = False Then Me.txt_Fields(7).text = Rs_SpecBill!产品发货要求
If IsNull(Rs_SpecBill!交货日期) = False Then Me.DTP1.Value = Rs_SpecBill!交货日期
If IsNull(Rs_SpecBill!订货数量) = False Then Me.MaskEdBox1.text = Rs_SpecBill!订货数量
'营销部录入部份
If IsNull(Rs_SpecBill!信息完整) = False Then Me.cob_M_Fields(0).text = Rs_SpecBill!信息完整 Else Me.cob_M_Fields(0).text = ""
If IsNull(Rs_SpecBill!质量等级) = False Then Me.cob_M_Fields(1).text = Rs_SpecBill!质量等级 Else Me.cob_M_Fields(1).text = ""
If IsNull(Rs_SpecBill!复制要求) = False Then Me.txt_M_Fields(4).text = Rs_SpecBill!复制要求 Else Me.txt_M_Fields(4).text = ""
If IsNull(Rs_SpecBill!品质要求) = False Then Me.txt_M_Fields(5).text = Rs_SpecBill!品质要求 Else Me.txt_M_Fields(5).text = ""
If IsNull(Rs_SpecBill!内编码) = False Then Me.txt_M_Fields(6).text = Rs_SpecBill!内编码 Else Me.txt_M_Fields(6).text = ""
If IsNull(Rs_SpecBill!料号) = False Then Me.txt_M_Fields(13).text = Rs_SpecBill!料号 Else Me.txt_M_Fields(13).text = ""
If IsNull(Rs_SpecBill!节目名称) = False Then Me.txt_M_Fields(7).text = Rs_SpecBill!节目名称 Else Me.txt_M_Fields(7).text = ""
If IsNull(Rs_SpecBill!母盘号码) = False Then Me.txt_M_Fields(8).text = Rs_SpecBill!母盘号码 Else Me.txt_M_Fields(8).text = ""
If IsNull(Rs_SpecBill!节目源种类) = False Then Me.cob_M_Fields(2).text = Rs_SpecBill!节目源种类 Else Me.cob_M_Fields(2).text = ""
If IsNull(Rs_SpecBill!节目种类) = False Then Me.cob_M_Fields(3).text = Rs_SpecBill!节目种类 Else Me.cob_M_Fields(3).text = ""
If IsNull(Rs_SpecBill!母盘刻字要求) = False Then Me.txt_M_Fields(9).text = Rs_SpecBill!母盘刻字要求 Else Me.txt_M_Fields(9).text = ""
If IsNull(Rs_SpecBill!刻录速度) = False Then Me.cob_M_Fields(4).text = Rs_SpecBill!刻录速度 Else Me.cob_M_Fields(4).text = ""
If IsNull(Rs_SpecBill!母盘内孔) = False Then Me.cob_M_Fields(5).text = Rs_SpecBill!母盘内孔 Else Me.cob_M_Fields(5).text = ""
If IsNull(Rs_SpecBill!菲林索引) = False Then Me.txt_M_Fields(10).text = Rs_SpecBill!菲林索引 Else Me.txt_M_Fields(10).text = ""
If IsNull(Rs_SpecBill!印刷参照) = False Then Me.cob_M_Fields(6).text = Rs_SpecBill!印刷参照 Else Me.cob_M_Fields(6).text = ""
If IsNull(Rs_SpecBill!印刷方式) = False Then Me.cob_M_Fields(7).text = Rs_SpecBill!印刷方式 Else Me.cob_M_Fields(7).text = ""
If IsNull(Rs_SpecBill!印刷颜色) = False Then Me.cob_M_Fields(8).text = Rs_SpecBill!印刷颜色 Else Me.cob_M_Fields(8).text = ""
If IsNull(Rs_SpecBill!委托书编码) = False Then Me.cob_M_Fields(9).text = Rs_SpecBill!委托书编码 Else Me.cob_M_Fields(9).text = ""
If IsNull(Rs_SpecBill!印刷要求) = False Then Me.txt_M_Fields(11).text = Rs_SpecBill!印刷要求 Else Me.txt_M_Fields(11).text = ""
If IsNull(Rs_SpecBill!包装要求) = False Then Me.txt_M_Fields(12).text = Rs_SpecBill!包装要求 Else Me.txt_M_Fields(12).text = ""
If IsNull(Rs_SpecBill!包装方式) = False Then Me.cob_M_Fields(10).text = Rs_SpecBill!包装方式 Else Me.cob_M_Fields(10).text = ""
If IsNull(Rs_SpecBill!印刷内圈) = False Then Me.cob_M_Fields(11).text = Rs_SpecBill!印刷内圈 Else Me.cob_M_Fields(11).text = ""
'品质部录入部分
If IsNull(Rs_SpecBill!母盘数量) = False Then Me.txt_Q_Fields(0).text = Rs_SpecBill!母盘数量 Else Me.txt_Q_Fields(0).text = ""
If IsNull(Rs_SpecBill!节目源状态) = False Then Me.cob_Q_Fields(0).text = Rs_SpecBill!节目源状态 Else Me.cob_Q_Fields(0).text = ""
' If IsNull(Rs_SpecBill!印刷内圈) = False Then Me.cob_Q_Fields(2).text = Rs_SpecBill!印刷内圈 Else Me.cob_Q_Fields(2).text = ""
If IsNull(Rs_SpecBill!菲林状态) = False Then Me.cob_Q_Fields(1).text = Rs_SpecBill!菲林状态 Else Me.cob_Q_Fields(1).text = ""
' If IsNull(Rs_SpecBill!特殊防尘垫要求) = False Then Me.txt_Q_Fields(1).text = Rs_SpecBill!特殊防尘垫要求 Else Me.txt_Q_Fields(1).text = ""
' If IsNull(Rs_SpecBill!特殊箱唛标识) = False Then Me.txt_Q_Fields(2).text = Rs_SpecBill!特殊箱唛标识 Else Me.txt_Q_Fields(2).text = ""
If IsNull(Rs_SpecBill!库位号) = False Then Me.txt_Q_Fields(1).text = Rs_SpecBill!库位号 Else Me.txt_Q_Fields(1).text = ""
If IsNull(Rs_SpecBill!财产备注) = False Then Me.txt_Q_Fields(2).text = Rs_SpecBill!财产备注 Else Me.txt_Q_Fields(2).text = ""
'生产部录入部分
If IsNull(Rs_SpecBill!印刷机号) = False Then Me.cob_S_Fields(0).text = Rs_SpecBill!印刷机号 Else Me.cob_S_Fields(0).text = ""
If IsNull(Rs_SpecBill!版状态) = False Then Me.cob_S_Fields(1).text = Rs_SpecBill!版状态 Else Me.cob_S_Fields(1).text = ""
If IsNull(Rs_SpecBill!专色油墨) = False Then Me.cob_S_Fields(2).text = Rs_SpecBill!专色油墨 Else Me.cob_S_Fields(2).text = ""
If IsNull(Rs_SpecBill!颜色样本) = False Then Me.cob_S_Fields(3).text = Rs_SpecBill!颜色样本 Else Me.cob_S_Fields(3).text = ""
If IsNull(Rs_SpecBill!不良率) = False And Rs_SpecBill!不良率 <> "" Then Me.Mask_S_Fields(0).text = Rs_SpecBill!不良率 Else Me.Mask_S_Fields(0).text = "00.00%"
If IsNull(Rs_SpecBill!剩余良品数) = False Then Me.Mask_S_Fields(1).text = Rs_SpecBill!剩余良品数 Else Me.Mask_S_Fields(1).text = 0
If IsNull(Rs_SpecBill!小于3000) = False Then Me.Mask_S_Fields(2).text = Rs_SpecBill!小于3000 Else Me.Mask_S_Fields(2).text = 0
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub Record_Move()
On Error GoTo err
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub Form_Load()
On Error GoTo err
'初始化
For i = 0 To 7
Me.txt_Fields(i).text = ""
Next
Me.MaskEdBox1.text = ""
For i = 0 To 13
Me.txt_M_Fields(i).text = ""
Next i
For i = 0 To 11
Me.cob_M_Fields(i).text = ""
Next i
For i = 0 To 2
Me.txt_Q_Fields(i).text = ""
Next i
For i = 0 To 1
Me.cob_Q_Fields(i).text = ""
Next i
For i = 0 To 3
Me.cob_S_Fields(i).text = ""
Next i
Me.Mask_S_Fields(0).text = "00.00%"
Me.Mask_S_Fields(1).text = 0
Me.Mask_S_Fields(2).text = 0
If Bln_SpecBillRepair = False And Bln_SpecBillView = True Then
Me.Toolbar1.Buttons(10).Enabled = False
Me.Toolbar1.Buttons(11).Enabled = False
Me.Frame1.Enabled = False
End If
Me.txt_Fields(0).Enabled = False
Me.txt_Fields(1).Enabled = False
Me.Frame3.Enabled = False
Me.Frame4.Enabled = False
Me.Frame5.Enabled = False
Call Area_Customer_Info
Call Customer_Riches_info
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call Frm_Whole_SpecBill.TDBGrid_Width_Set
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error GoTo err
Select Case Button.Index
Case 5 '单击最前
If Not Rs_SpecBill.BOF Then
Rs_SpecBill.MoveFirst
Call Area_Customer_Info
Call Customer_Riches_info
End If
'如果是单击添加时
Call Record_Move
Case 6 '单击前一条
Rs_SpecBill.MovePrevious
If Not Rs_SpecBill.BOF Then
Call Area_Customer_Info
Call Customer_Riches_info
Else
Rs_SpecBill.MoveFirst
Call Area_Customer_Info
Call Customer_Riches_info
End If
'如果是单击添加时
Call Record_Move
Case 7 '单击后一条
Rs_SpecBill.MoveNext
If Not Rs_SpecBill.EOF Then
Call Area_Customer_Info
Call Customer_Riches_info
Else
Rs_SpecBill.MoveLast
Call Area_Customer_Info
Call Customer_Riches_info
End If
'如果是单击添加时
Call Record_Move
Case 8 '单击最后
If Not Rs_SpecBill.EOF Then
Rs_SpecBill.MoveLast
Call Area_Customer_Info
Call Customer_Riches_info
End If
'如果是单击添加时
Call Record_Move
Case 10 '单击确认
If Bln_SpecBillRepair = True And Bln_SpecBillView = False Then
'保存信息节目下单时其他要求
Rs_SpecBill!箱面标识 = Me.txt_Fields(2).text
Rs_SpecBill!箱号 = Me.txt_Fields(3).text
Rs_SpecBill!合同号 = Me.txt_Fields(4).text
Rs_SpecBill!备注 = Me.txt_Fields(5).text
Rs_SpecBill!产品技术要求 = Me.txt_Fields(6).text
Rs_SpecBill!产品发货要求 = Me.txt_Fields(7).text
Rs_SpecBill!交货日期 = Me.DTP1.Value
Rs_SpecBill!订货数量 = Val(Me.MaskEdBox1.text)
Rs_SpecBill.Update
' Frm_Whole_SpecBill.TDBGrid_CusRiches.Close
' If Rs_SpecBill.State = 1 Then Rs_SpecBill.Close
' Rs_SpecBill.Open "select * from Spec_Bill order by 规格单号,小号", Cn_SpecBill, adOpenKeyset, adLockOptimistic, adCmdText
' If Rs_SpecBill.RecordCount <> 0 Then Rs_SpecBill.MoveLast
' Set Me.TDBGrid_CusRiches.DataSource = Rs_SpecBill
Call Frm_Whole_SpecBill.TDBGrid_Width_Set
MsgBox "数据修改成功!"
End If
Unload Me
Case 11 '更新客户财产信息
Set Cn_Common = New ADODB.Connection
Cn_Common.Open Cs
Set Rs_Common = New ADODB.Recordset
Rs_Common.Open "select * from Customer_Riches where 内编码 ='" & Rs_SpecBill!内编码 & "'", Cn_Common, adOpenKeyset, adLockOptimistic, adCmdText
If Rs_Common.RecordCount <> 0 Then
If IsNull(Rs_Common!信息完整) = False Then
Rs_SpecBill!信息完整 = Rs_Common!信息完整
Me.cob_M_Fields(0).text = Rs_Common!信息完整
Else
Rs_SpecBill!信息完整 = ""
Me.cob_M_Fields(0).text = ""
End If
If IsNull(Rs_Common!质量等级) = False Then
Rs_SpecBill!质量等级 = Rs_Common!质量等级
Me.cob_M_Fields(1).text = Rs_Common!质量等级
Else
Rs_SpecBill!质量等级 = ""
Me.cob_M_Fields(1).text = ""
End If
If IsNull(Rs_Common!复制要求) = False Then
Rs_SpecBill!复制要求 = Rs_Common!复制要求
Me.txt_M_Fields(4).text = Rs_Common!复制要求
Else
Rs_SpecBill!复制要求 = ""
Me.txt_M_Fields(4).text = ""
End If
If IsNull(Rs_Common!品质要求) = False Then
Rs_SpecBill!品质要求 = Rs_Common!品质要求
Me.txt_M_Fields(5).text = Rs_Common!品质要求
Else
Rs_SpecBill!品质要求 = ""
Me.txt_M_Fields(5).text = ""
End If
If IsNull(Rs_Common!料号) = False Then
Rs_SpecBill!料号 = Rs_Common!料号
Me.txt_M_Fields(13).text = Rs_Common!料号
Else
Rs_SpecBill!料号 = ""
Me.txt_M_Fields(13).text = ""
End If
If IsNull(Rs_Common!节目名称) = False Then
Rs_SpecBill!节目名称 = Rs_Common!节目名称
Me.txt_M_Fields(7).text = Rs_Common!节目名称
Else
Rs_SpecBill!节目名称 = ""
Me.txt_M_Fields(7).text = ""
End If
If IsNull(Rs_Common!母盘号码) = False Then
Rs_SpecBill!母盘号码 = Rs_Common!母盘号码
Me.txt_M_Fields(8).text = Rs_Common!母盘号码
Else
Rs_SpecBill!母盘号码 = ""
Me.txt_M_Fields(8).text = ""
End If
If IsNull(Rs_Common!节目源种类) = False Then
Rs_SpecBill!节目源种类 = Rs_Common!节目源种类
Me.cob_M_Fields(2).text = Rs_Common!节目源种类
Else
Rs_SpecBill!节目源种类 = ""
Me.cob_M_Fields(2).text = ""
End If
If IsNull(Rs_Common!节目种类) = False Then
Rs_SpecBill!节目种类 = Rs_Common!节目种类
Me.cob_M_Fields(3).text = Rs_Common!节目种类
Else
Rs_SpecBill!节目种类 = ""
Me.cob_M_Fields(3).text = ""
End If
If IsNull(Rs_Common!母盘刻字要求) = False Then
Rs_SpecBill!母盘刻字要求 = Rs_Common!母盘刻字要求
Me.txt_M_Fields(9).text = Rs_Common!母盘刻字要求
Else
Rs_SpecBill!母盘刻字要求 = ""
Me.txt_M_Fields(9).text = ""
End If
If IsNull(Rs_Common!刻录速度) = False Then
Rs_SpecBill!刻录速度 = Rs_Common!刻录速度
Me.cob_M_Fields(4).text = Rs_Common!刻录速度
Else
Rs_SpecBill!刻录速度 = ""
Me.cob_M_Fields(4).text = ""
End If
If IsNull(Rs_Common!母盘内孔) = False Then
Rs_SpecBill!母盘内孔 = Rs_Common!母盘内孔
Me.cob_M_Fields(5).text = Rs_Common!母盘内孔
Else
Rs_SpecBill!母盘内孔 = ""
Me.cob_M_Fields(5).text = ""
End If
If IsNull(Rs_Common!菲林索引) = False Then
Rs_SpecBill!菲林索引 = Rs_Common!菲林索引
Me.txt_M_Fields(10).text = Rs_Common!菲林索引
Else
Rs_SpecBill!菲林索引 = ""
Me.txt_M_Fields(10).text = ""
End If
If IsNull(Rs_Common!印刷参照) = False Then
Rs_SpecBill!印刷参照 = Rs_Common!印刷参照
Me.cob_M_Fields(6).text = Rs_Common!印刷参照
Else
Rs_SpecBill!印刷参照 = ""
Me.cob_M_Fields(6).text = ""
End If
If IsNull(Rs_Common!印刷方式) = False Then
Rs_SpecBill!印刷方式 = Rs_Common!印刷方式
Me.cob_M_Fields(7).text = Rs_Common!印刷方式
Else
Rs_SpecBill!印刷方式 = ""
Me.cob_M_Fields(7).text = ""
End If
If IsNull(Rs_Common!印刷颜色) = False Then
Rs_SpecBill!印刷颜色 = Rs_Common!印刷颜色
Me.cob_M_Fields(8).text = Rs_Common!印刷颜色
Else
Rs_SpecBill!印刷颜色 = ""
Me.cob_M_Fields(8).text = ""
End If
If IsNull(Rs_Common!委托书编码) = False Then
Rs_SpecBill!委托书编码 = Rs_Common!委托书编码
Me.cob_M_Fields(9).text = Rs_Common!委托书编码
Else
Rs_SpecBill!委托书编码 = ""
Me.cob_M_Fields(9).text = ""
End If
If IsNull(Rs_Common!印刷要求) = False Then
Rs_SpecBill!印刷要求 = Rs_Common!印刷要求
Me.txt_M_Fields(11).text = Rs_Common!印刷要求
Else
Rs_SpecBill!印刷要求 = ""
Me.txt_M_Fields(11).text = ""
End If
If IsNull(Rs_Common!包装要求) = False Then
Rs_SpecBill!包装要求 = Rs_Common!包装要求
Me.txt_M_Fields(12).text = Rs_Common!包装要求
Else
Rs_SpecBill!包装要求 = ""
Me.txt_M_Fields(12).text = ""
End If
If IsNull(Rs_Common!包装方式) = False Then
Rs_SpecBill!包装方式 = Rs_Common!包装方式
Me.cob_M_Fields(10).text = Rs_Common!包装方式
Else
Rs_SpecBill!包装方式 = ""
Me.cob_M_Fields(10).text = ""
End If
If IsNull(Rs_Common!印刷内圈) = False Then
Rs_SpecBill!印刷内圈 = Rs_Common!印刷内圈
Me.cob_M_Fields(11).text = Rs_Common!印刷内圈
Else
Rs_SpecBill!印刷内圈 = ""
Me.cob_M_Fields(11).text = ""
End If
End If
Rs_Common.Close
Cn_Common.Close
Rs_SpecBill.Update
MsgBox "客户财产信息已经更新成功!"
Case 12 '单击退出
Unload Me
End Select
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -