📄 frmplang.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Begin VB.Form frmPLANG
Caption = "计划单信息"
ClientHeight = 6135
ClientLeft = 45
ClientTop = 345
ClientWidth = 8190
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 6135
ScaleWidth = 8190
WindowState = 2 'Maximized
Begin VB.TextBox txtJLDW
Height = 372
Left = 7680
TabIndex = 15
Top = 5040
Visible = 0 'False
Width = 252
End
Begin VB.TextBox txtWZMC
Height = 372
Left = 7200
TabIndex = 14
Top = 5040
Visible = 0 'False
Width = 252
End
Begin VB.TextBox txtWZDM
Height = 372
Left = 360
TabIndex = 13
Top = 5520
Visible = 0 'False
Width = 252
End
Begin VB.TextBox txt_YWDM
Height = 372
Left = 0
TabIndex = 12
Top = 5520
Visible = 0 'False
Width = 252
End
Begin VB.TextBox txtM_DATE
Height = 372
Left = 480
TabIndex = 11
Top = 5040
Visible = 0 'False
Width = 252
End
Begin VB.TextBox txtM_NO
Height = 372
Left = 0
TabIndex = 10
Top = 5040
Visible = 0 'False
Width = 252
End
Begin VB.Frame Frame1
Caption = "计划单基本信息:"
Height = 840
Index = 0
Left = 120
TabIndex = 2
Top = 10
Width = 7932
Begin VB.CommandButton Command1
Caption = "确定计划单"
Height = 375
Left = 6480
TabIndex = 16
Top = 360
Width = 1215
End
Begin VB.TextBox txtItem
Height = 270
Index = 0
Left = 960
MaxLength = 20
TabIndex = 5
Top = 360
Width = 615
End
Begin VB.ComboBox Combo1
Height = 315
Index = 0
Left = 5160
Style = 2 'Dropdown List
TabIndex = 4
Top = 360
Width = 1215
End
Begin VB.TextBox txtItem
Height = 270
Index = 1
Left = 2520
MaxLength = 20
TabIndex = 3
Top = 360
Width = 1572
End
Begin VB.Label Label2
Caption = "业 务 员:"
Height = 255
Index = 3
Left = 4200
TabIndex = 8
Top = 360
Width = 1095
End
Begin VB.Label Label2
Caption = "计划单编号:"
Height = 252
Index = 0
Left = 120
TabIndex = 7
Top = 360
Width = 1092
End
Begin VB.Label Label2
Caption = "日 期:"
Height = 255
Index = 5
Left = 1680
TabIndex = 6
Top = 360
Width = 1095
End
End
Begin VB.Frame Frame1
Caption = "产品信息"
Height = 3972
Index = 1
Left = 120
TabIndex = 0
Top = 960
Width = 7932
Begin MSFlexGridLib.MSFlexGrid msgList
Height = 3252
Left = 120
TabIndex = 1
Top = 240
Width = 7692
_ExtentX = 13573
_ExtentY = 5741
_Version = 393216
Cols = 4
FixedCols = 2
AllowUserResizing= 1
End
End
Begin VB.Label lblTitle
Caption = "生 产 配 料 单 设 置 信 息 列 表"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 252
Left = 480
TabIndex = 9
Top = 240
Visible = 0 'False
Width = 5532
End
End
Attribute VB_Name = "frmPLANG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public txtSQL As String
Dim mrc As adodb.Recordset
'用户的读写权限标识
Dim mintRW As Integer
'状态条中显示的时间信息
Public msBarText As String
Public reportSQL As String
Public Sub RecordRefresh()
'显示数据
msBarText = "当前数据时间范围:" & Format(DateAdd("m", -1, Now), "yyyy-mm-dd") & "至" & Format(Now, "yyyy-mm-dd")
ShowData
End Sub
Public Sub RecordAdd()
Dim sSQL As String
Dim intCount As Integer
Dim recTemp As adodb.Recordset
Dim MsgText As String
If gintPLANGLISTmode = 1 Then
If Trim(txtItem(0)) <> "" And Trim(Combo1(0)) <> "" Then
sSQL = "select * from plang where pl_no ='" & Trim(txtItem(0)) & "'"
Set recTemp = ExecuteSQL(sSQL, MsgText)
If recTemp.EOF = False Then
MsgBox "已经存在相同编号的计划单记录!", vbOKOnly + vbExclamation, "警告"
txtItem(0).SetFocus
recTemp.Close
Exit Sub
End If
frmPLANG1.txtM_NO = Trim(txtItem(0))
frmPLANG1.txtM_DATE = Trim(txtItem(1))
frmPLANG1.txtYWDM = Trim(Combo1(0).ItemData(Combo1(0).ListIndex))
gintPLANGmode = 1
frmPLANG1.Show 1
Else
MsgBox "请设置生产计划单的所有选项!", vbOKOnly, "警告"
Exit Sub
End If
ElseIf gintPLANGLISTmode = 2 Then
frmPLANG1.txtM_NO = Trim(txtItem(0))
frmPLANG1.txtM_DATE = Trim(txtItem(1))
frmPLANG1.txtYWDM = Trim(Combo1(0).ItemData(Combo1(0).ListIndex))
gintPLANGmode = 1
frmPLANG1.Show 1
End If
End Sub
'删除记录
Public Sub RecordDelete()
Dim sSQL As String
Dim intCount As Integer
Dim recTemp As adodb.Recordset
Dim MsgText As String
On Error GoTo myErr
If msgList.Rows > 1 Then
If MsgBox("真的要删除编号为" & Trim(msgList.TextMatrix(msgList.Row, 1)) & "的原材料记录吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
intCount = msgList.Row
sSQL = "delete from plang where pl_no ='" & Trim(msgList.TextMatrix(intCount, 1)) & "' and dm = '" & Trim(msgList.TextMatrix(intCount, 2)) & "'"
Set recTemp = ExecuteSQL(sSQL, MsgText)
ShowData
End If
End If
Exit Sub
myErr:
ShowError
End Sub
Public Sub RecordEdit()
Dim sSQL As String
Dim intCount As Integer
Dim recTemp As adodb.Recordset
Dim MsgText As String
If msgList.Rows > 1 Then
gintPLANGmode = 2
intCount = msgList.Row
If intCount > 0 Then
frmPLANG1.txtSQL = "select dm,mc,jldw,pl_sl,dj,jine,cp_date,st_date from plang where pl_no ='" & Trim(msgList.TextMatrix(intCount, 1)) & "' and dm = '" & Trim(msgList.TextMatrix(intCount, 2)) & "'"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -