📄 frmdb.frm
字号:
End
Begin VB.Label Label22
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "调入部门"
Height = 180
Left = 240
TabIndex = 11
Top = 1020
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "调出金额总计"
Height = 180
Left = 4800
TabIndex = 10
Top = 4440
Width = 1080
End
Begin VB.Label Label12
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "调入金额总计"
Height = 180
Left = 7905
TabIndex = 9
Top = 4455
Width = 1080
End
End
Begin MSComctlLib.StatusBar stbData
Align = 2 'Align Bottom
Height = 375
Left = 0
TabIndex = 19
Top = 6330
Width = 11145
_ExtentX = 19659
_ExtentY = 661
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 2
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 5292
MinWidth = 5292
Key = "状态信息"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 14288
EndProperty
EndProperty
End
Begin Threed.SSPanel SSPanel1
Align = 1 'Align Top
Height = 555
Left = 0
TabIndex = 20
Top = 0
Width = 11145
_ExtentX = 19659
_ExtentY = 979
_Version = 131073
BorderWidth = 0
BevelInner = 1
Begin Threed.SSCommand cmdToolSelect
CausesValidation= 0 'False
Height = 465
Left = 7485
TabIndex = 32
Tag = "退出"
ToolTipText = "退出"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "选择[&R]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdPrintBill
CausesValidation= 0 'False
Height = 465
Left = 6540
TabIndex = 29
Tag = "下一条"
ToolTipText = "打印单据"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "打印[&P]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdToolAdd
CausesValidation= 0 'False
Height = 465
Left = 36
TabIndex = 28
Tag = "新建"
ToolTipText = "新建单据"
Top = 36
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "新建[&N]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdToolCommit
Height = 465
Left = 960
TabIndex = 27
Tag = "确认"
ToolTipText = "确认单据,使之生效"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "审核[&O]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdToolSave
Height = 465
Left = 1890
TabIndex = 26
Tag = "保存"
ToolTipText = "保存单据"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "保存[&S]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdToolDelete
CausesValidation= 0 'False
Height = 465
Left = 2820
TabIndex = 25
Tag = "删除"
ToolTipText = "删除当前单据"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "删除[&D]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdToolQuery
CausesValidation= 0 'False
Height = 465
Left = 3750
TabIndex = 24
Tag = "查询"
ToolTipText = "查询单据内容"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "查询[&Q]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdToolPrevious
CausesValidation= 0 'False
Height = 465
Left = 4680
TabIndex = 23
Tag = "上一条"
ToolTipText = "翻至上一页"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "上一条[&U]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdToolNext
CausesValidation= 0 'False
Height = 465
Left = 5610
TabIndex = 22
Tag = "下一条"
ToolTipText = "翻至下一页"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "下一条[&M]"
ButtonStyle = 3
BevelWidth = 0
End
Begin Threed.SSCommand cmdToolExit
CausesValidation= 0 'False
Height = 465
Left = 8430
TabIndex = 21
TabStop = 0 'False
Tag = "退出"
ToolTipText = "退出"
Top = 30
Width = 930
_ExtentX = 1640
_ExtentY = 820
_Version = 131073
ForeColor = 0
Caption = "退出[&X]"
ButtonStyle = 3
BevelWidth = 0
End
End
Begin VB.Label Label6
BackColor = &H00404040&
Height = 5505
Left = 375
TabIndex = 16
Top = 675
Width = 10635
End
End
Attribute VB_Name = "frmDB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::商品调拨管理模块::::::::::::::::::::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Option Explicit
Private Rs As New ADODB.Recordset '用于只打开单记录集时
Private Const TableName As String = "LSDBD" '定义表头名称
Private QueryFlag As Boolean '记录查询状态
Private TableState As String
'当前状态
Private Function AcceptVil(d As Boolean) As Boolean
On Error GoTo CommErr
Dim N, i
Dim RsStore As New ADODB.Recordset
Dim IIprc, IIIprc, Qty As Single, sum, ssum
If Not CommSaveTable() Then
MsgBox "保存数据时发生错误!", vbExclamation, "错误窗口"
Exit Function
End If
Conn.BeginTrans
If d Then
sSQL = "UPDATE LSDBD SET 确认状态=1 WHERE 表单号='" & Trim(txtPurcode.Text) & "'"
Else
sSQL = "UPDATE LSDBD SET 确认状态=0 WHERE 表单号='" & Trim(txtPurcode.Text) & "'"
End If
For i = 0 To grdDET.Rows - 1
grdDET.Row = i
If d Then
Qty = grdDET.Columns("数量").Value
Else
Qty = -grdDET.Columns("数量").Value
End If
If Not InSubStock(cmbGrpOut.Text, grdDET.Columns("商品编码").Text, grdDET.Columns("品名").Text, _
grdDET.Columns("单位").Text, grdDET.Columns("颜色").Text, grdDET.Columns("尺寸").Text, _
-Qty, grdDET.Columns("调出价").Value, 0) Then
MsgBox "确认失败!,请检查数据是否正确!", vbInformation, "提示窗口"
Conn.RollbackTrans
Exit Function
End If
If Not InSubStock(cmbGrpIn.Text, grdDET.Columns("商品编码").Text, grdDET.Columns("品名").Text, _
grdDET.Columns("单位").Text, grdDET.Columns("颜色").Text, grdDET.Columns("尺寸").Text, _
Qty, grdDET.Columns("调入价").Value, 0) Then
MsgBox "确认失败!,请检查数据是否正确!", vbInformation, "提示窗口"
Conn.RollbackTrans
Exit Function
End If
Next i
If d Then
cmdToolCommit.Caption = "弃审[&O]"
cmdToolSave.Enabled = False
cmdToolDelete.Enabled = False
grdDET.AllowUpdate = False
grdDET.SelectByCell = True
Else
cmdToolCommit.Caption = "审核[&O]"
cmdToolSave.Enabled = True
cmdToolDelete.Enabled = True
grdDET.AllowUpdate = True
grdDET.SelectByCell = False
End If
Conn.CommitTrans
Exit Function
CommErr:
Conn.RollbackTrans
MsgBox "调拨失败!!!", vbInformation, "错误窗口"
End Function
Private Function CommSaveTable() As Boolean
On Error GoTo CommSaveErr
sSQL = "DELETE FROM " & TableName & " WHERE 表单号='" & txtPurcode.Text & "'"
Cmd.ActiveConnection = Conn
Cmd.CommandText = sSQL
Cmd.Execute
If SaveTable() Then
CommSaveTable = True
Exit Function
Else
CommSaveTable = False
Exit Function
End If
CommSaveErr:
CommSaveTable = False
End Function
'
'检查数据是否合法
'
Private Function DataOK() As Boolean
If Trim(txtPurcode.Text) = "" Then
DataOK = False
Exit Function
End If
If Trim(txtIptno.Text) = "" Then
DataOK = False
Exit Function
End If
If grdDET.Rows = 0 Then
DataOK = False
Exit Function
End If
DataOK = True
End Function
'在状态条上显示记录信息和状态信息
Private Sub ShowStatus(Flag As Integer)
Select Case Flag
Case 0 '查询记录移动
If Rs.EOF Then
Temp = "已经移到记录末尾了"
ElseIf Rs.BOF Then
Temp = "已经移到记录开始"
Else
Temp = "第" & Rs.AbsolutePosition & "条"
End If
stbData.Panels("状态信息").Text = "总共:" & Rs.RecordCount & _
"条之第: " & Temp
Case 1 '开始查询
stbData.Panels("状态信息").Text = "请输入查询条件:"
Case 2 '请输入新表单
stbData.Panels("状态信息").Text = "请输入新表单:"
Case 3 '保存表单
stbData.Panels("状态信息").Text = "表单保存完毕"
Case 4 '保存表单
stbData.Panels("状态信息").Text = "该表单已经确认"
Case 5
stbData.Panels("状态信息").Text = "该表单已经删除 "
Case Else
stbData.Panels("状态信息").Text = ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -