📄 结算方案参数.frm
字号:
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2880
TabIndex = 29
Top = 3000
Width = 1140
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "流水号"
BeginProperty Font
Name = "黑体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 300
Left = 8520
TabIndex = 28
Top = 120
Width = 900
End
Begin VB.Label Lablsh
Alignment = 2 'Center
BackStyle = 0 'Transparent
BeginProperty Font
Name = "黑体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 8040
TabIndex = 27
Top = 600
Width = 2055
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "工序名称"
BeginProperty Font
Name = "黑体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2880
TabIndex = 26
Top = 120
Width = 1140
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "品 名"
BeginProperty Font
Name = "黑体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 3000
TabIndex = 25
Top = 1080
Width = 870
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "一级品价"
BeginProperty Font
Name = "黑体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2880
TabIndex = 21
Top = 2520
Width = 1140
End
End
Attribute VB_Name = "FrmJsfacs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim CmdExe As ADODB.Command
Dim Mrc As ADODB.Recordset
Dim RsGg As ADODB.Recordset
Dim AddFlg As Boolean
Dim CJMC As String
Private Sub CmbPM_Click()
If Trim(CmbPM.Text) = "" Then
CmbPM.SetFocus
Else
Dim Mrc As ADODB.Recordset
Set Mrc = New ADODB.Recordset
TxtSql = "select * from Bs_产品图号 where 品名='" & CmbPM.Text & "'"
Mrc.Open Trim$(TxtSql), Cw_DataEnvi.DataConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
If Mrc.EOF = True Then
CmbPM.SetFocus
MsgBox "请正确填选品名!"
Exit Sub
End If
CmbTH.Text = Mrc!图号
TxtGG.Text = Mrc!规格
TxtXc.Text = Mrc!硝材
Mrc.Close
End If
End Sub
Private Sub CmbPM_LostFocus()
Dim Mrc As ADODB.Recordset
Set Mrc = New ADODB.Recordset
TxtSql = "select * from Bs_产品图号 where 品名='" & CmbPM.Text & "'"
Mrc.Open Trim$(TxtSql), Cw_DataEnvi.DataConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
If Mrc.EOF = True Then
MsgBox "没有此品名!"
CmbTH.SetFocus
CmbTH.Text = ""
TxtGG.Text = ""
Exit Sub
End If
CmbTH.Text = Mrc!图号
TxtGG.Text = Mrc!规格
TxtXc.Text = Mrc!硝材
Mrc.Close
End Sub
Private Sub CmbTH_LostFocus()
Dim Mrc As ADODB.Recordset
Set Mrc = New ADODB.Recordset
TxtSql = "select * from Bs_产品图号 where 图号='" & CmbTH.Text & "'"
Mrc.Open Trim$(TxtSql), Cw_DataEnvi.DataConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
If Mrc.EOF = True Then
CmbPM.Text = ""
TxtGG.Text = ""
Exit Sub
End If
CmbPM.Text = Mrc!品名
TxtGG.Text = Mrc!规格
TxtXc.Text = Mrc!硝材
Mrc.Close
End Sub
Private Sub CmbTH_Click()
If Trim(CmbTH.Text) = "" Then
CmbTH.SetFocus
Else
Dim Mrc As ADODB.Recordset
Set Mrc = New ADODB.Recordset
TxtSql = "select * from Bs_产品图号 where 图号='" & CmbTH.Text & "'"
Mrc.Open Trim$(TxtSql), Cw_DataEnvi.DataConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
If Mrc.EOF = True Then
CmbTH.SetFocus
MsgBox "请正确填选图号!"
Exit Sub
End If
CmbPM.Text = Mrc!品名
TxtGG.Text = Mrc!规格
TxtXc.Text = Mrc!硝材
Mrc.Close
End If
End Sub
Private Sub Command1_Click()
Call Toolbjzt
AddFlg = True
CmbTH.Text = ""
CmbPM.Text = ""
TxtGG.Text = ""
TxtXc.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Lablsh.Caption = ""
End Sub
Private Sub Command10_Click()
Cdlg.DialogTitle = "另存为Excel文件:"
Cdlg.Filter = "Excel文件|*.Xls|所有文件|*.*"
Cdlg.ShowSave
If Cdlg.FileName = "" Then Exit Sub
OutTxt.Text = Cdlg.FileName
End Sub
Private Sub Command2_Click()
Call Toolbjzt
AddFlg = False
End Sub
Private Sub Command3_Click()
If vbYes = MsgBox("确认要删除此记录么?(" & Lablsh.Caption & ")", vbYesNo, "删除对话框") Then
CmdExe.CommandText = "delete from Gz_基础数据 where id='" & Lablsh.Caption & "'"
CmdExe.Execute
CmbTH.Text = ""
CmbPM.Text = ""
TxtGG.Text = ""
TxtXc.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Lablsh.Caption = ""
Call ToolList
End If
Call Toolfbjzt
End Sub
Private Sub Command4_Click()
'=添加人员权限检测=
On Error GoTo Errline
If Trim(CmbGx.Text) = "" Then
CmbGx.SetFocus
MsgBox "请正确填选工序名称!"
Exit Sub
Else
Set Mrc = New ADODB.Recordset
TxtSql = "select * from Bs_生产流程 where 工序名称 = '" & CmbGx.Text & "'"
Mrc.Open Trim$(TxtSql), Cw_DataEnvi.DataConnect, adOpenKeyset, adLockOptimistic
Set ExecuteSQL = Mrc
If Mrc.EOF = True Then
CmbGx.SetFocus
MsgBox "请正确填选工序名称!"
Exit Sub
End If
Mrc.Close
End If
If Trim(CmbTH.Text) = "" Then
CmbTH.SetFocus
MsgBox "请正确填选图号、品名规格!"
Exit Sub
Else
Set Mrc = New ADODB.Recordset
TxtSql = "select * from Bs_产品图号 where 图号='" & CmbTH.Text & "'"
Mrc.Open Trim$(TxtSql), Cw_DataEnvi.DataConnect, adOpenKeyset, adLockOptimistic
Set ExecuteSQL = Mrc
If Mrc.EOF = True Then
CmbTH.SetFocus
MsgBox "请正确填选图号、品名规格!"
Exit Sub
End If
CmbPM.Text = Mrc!品名
TxtGG.Text = Mrc!规格
Mrc.Close
End If
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Or Trim(Text3.Text) = "" Or Trim(Text4.Text) = "" Or Trim(Text5.Text) = "" Or Trim(Text6.Text) = "" Or Trim(Text7.Text) = "" Then
MsgBox "填写参数错误!"
Text1.SetFocus
Exit Sub
End If
If AddFlg = True Then '添加
SqlTxt = "INSERT INTO Gz_基础数据(工序名称,图号,一级品价,二级品价,料质价,原材料价,成品率,一废品率,二废品率,创建者) VALUES ('" & CmbGx.Text _
& "', '" & CmbTH.Text & "', " & Text1.Text & ", " & Text2.Text & ", " & Text3.Text & "," & Text4.Text & "," & Text5.Text & "," & Text6.Text & "," & Text7.Text _
& ",'" & Xtczy & "')"
CmdExe.CommandText = SqlTxt
CmdExe.Execute
MsgBox "记录添加成功!", vbInformation
Else '修改
SqlTxt = "Update Gz_基础数据 Set 工序名称='" & CmbGx.Text & "',图号='" & CmbTH.Text & "',一级品价=" & Text1.Text & ",二级品价=" & Text2.Text _
& ",料质价=" & Text3.Text & ",原材料价=" & Text4.Text & ",成品率=" & Text5.Text & ",一废品率=" & Text6.Text & ",二废品率=" & Text7.Text _
& ",创建者='" & Xtczy & "' WHERE (ID=" & Lablsh.Caption & ")"
CmdExe.CommandText = SqlTxt
CmdExe.Execute
MsgBox "记录修改成功!", vbInformation
End If
Call ToolList
Call Toolfbjzt
Command1.SetFocus
Exit Sub
Errline:
MsgBox err.Description, vbCritical, err.Number
Call Toolfbjzt
Command1.SetFocus
End Sub
Private Sub Command5_Click()
Call Toolfbjzt
End Sub
Private Sub Command6_Click()
Dim Sqlstr As String '查询连接串
'为加快显示速度,将网格刷新动作冻结
'[>>查询连接串
Sqlstr = "SELECT Gz_基础数据.id,工序名称,Gz_基础数据.图号,品名,规格,硝材,一级品价,二级品价,料质价,原材料价,成品率,一废品率,二废品率 FROM Gz_基础数据,BS_产品图号 where Gz_基础数据.图号=BS_产品图号.图号 and 品名 like '%" & TxtPmSc.Text & "%' and Gz_基础数据.图号 like '%" & TxtThSc.Text & "%' and 规格 like '%" & TxtGgSc.Text & "%' order by Gz_基础数据.图号"
'<<]
Set Jlbrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
'[>>以下为自定义部分
Dim ItmX As ListItem
lstContracts.ListItems.Clear
Do While Not Jlbrec.EOF
Set ItmX = lstContracts.ListItems.Add(, , Jlbrec!Id)
ItmX.SubItems(1) = Jlbrec!工序名称
ItmX.SubItems(2) = Jlbrec!图号
ItmX.SubItems(3) = Jlbrec!品名
ItmX.SubItems(4) = Jlbrec!规格
ItmX.SubItems(5) = Jlbrec!硝材
ItmX.SubItems(6) = Jlbrec!一级品价
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -