📄 frmotherck.frm
字号:
VERSION 5.00
Begin VB.Form frmOtherCK
Caption = "其它入库审核"
ClientHeight = 4260
ClientLeft = 60
ClientTop = 345
ClientWidth = 6975
Icon = "frmOtherCK.frx":0000
MaxButton = 0 'False
ScaleHeight = 4260
ScaleWidth = 6975
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton CmdCheck
Caption = "全部放弃(&U)"
Height = 375
Index = 1
Left = 5160
TabIndex = 4
Top = 1920
Width = 1635
End
Begin VB.CommandButton CmdCheck
Caption = "全部选中(&A)"
Height = 375
Index = 0
Left = 5160
TabIndex = 3
Top = 1140
Width = 1635
End
Begin VB.CommandButton CmdCheck
Caption = "退出(&X)"
Height = 375
Index = 3
Left = 5160
TabIndex = 2
Top = 3480
Width = 1635
End
Begin VB.CommandButton CmdCheck
Caption = "审核过帐(&C)"
Height = 375
Index = 2
Left = 5160
TabIndex = 1
Top = 2700
Width = 1635
End
Begin VB.ListBox LstDJ
Height = 3420
Left = 120
Style = 1 'Checkbox
TabIndex = 0
Top = 720
Width = 4755
End
Begin VB.Label LblCap
Caption = "单据编号 日期"
Height = 195
Index = 1
Left = 360
TabIndex = 6
Top = 480
Width = 4395
End
Begin VB.Label LblCap
Caption = "请先选中将要审核过帐的单据,然后点击“审核过帐”按钮"
Height = 195
Index = 0
Left = 120
TabIndex = 5
Top = 120
Width = 5235
End
End
Attribute VB_Name = "frmOtherCK"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsOtCk As ADODB.Recordset
Dim cmdOtCk As ADODB.Command
Dim rsQ As ADODB.Recordset
Private Sub CmdCheck_Click(Index As Integer)
Dim intNum As Integer
Select Case Index
Case 0
For intNum = 0 To Me.LstDJ.ListCount - 1
If Me.LstDJ.Selected(intNum) = False Then
Me.LstDJ.Selected(intNum) = True
End If
Next
Case 1
For intNum = 0 To Me.LstDJ.ListCount - 1
If Me.LstDJ.Selected(intNum) = True Then
Me.LstDJ.Selected(intNum) = False
End If
Next
Case 2
Call OtCK
For intNum = Me.LstDJ.ListCount - 1 To 0 Step -1
If Me.LstDJ.Selected(intNum) = True Then
Me.LstDJ.RemoveItem intNum
End If
Next
MsgBox "审核过帐完毕!", , "审核过帐"
Case 3
Unload Me
End Select
End Sub
Private Sub OtCK()
Dim strsql As String
Dim intNum As Integer
Dim strOtID As String
For intNum = 0 To Me.LstDJ.ListCount - 1
If Me.LstDJ.Selected(intNum) = True Then
strOtID = Left(Me.LstDJ.List(intNum), 9)
strsql = "select 商品编号,sum(数量) as tq,sum(总额) as tp from " & _
"库存表_tmp where 入库编号='" & strOtID & "' group by " & _
"商品编号"
Set rsQ = ExecuteSQL(strsql)
With rsQ
.MoveFirst
While Not .EOF
strsql = "update 盘点表 set 数量=数量+" & !tq & _
",总额=总额+" & !tp & " where 商品编号='" & !商品编号 & "'"
cmdOtCk.CommandText = strsql
cmdOtCk.Execute
.MoveNext
Wend
End With
rsQ.Close
'将[其它入库表_tmp]中的记录移动到[其它入库表]中
strsql = "insert into 其它入库表 select * from 其它入库表_tmp " & _
"where 入库编号='" & strOtID & "'"
cmdOtCk.CommandText = strsql
cmdOtCk.Execute
strsql = "delete from 其它入库表_tmp where 入库编号='" & strOtID & "'"
cmdOtCk.CommandText = strsql
cmdOtCk.Execute
'将[库存表_tmp]中的记录移动到[库存表]中
strsql = "insert into 库存表 select * from 库存表_tmp where 入库编号='" & strOtID & "'"
cmdOtCk.CommandText = strsql
cmdOtCk.Execute
strsql = "delete from 库存表_tmp where 入库编号='" & strOtID & "'"
cmdOtCk.CommandText = strsql
cmdOtCk.Execute
End If
Next
End Sub
Private Sub Form_Load()
Dim strsql As String
Dim strItem As String
strsql = "select * from 其它入库表_tmp order by 入库编号"
'Set rsPsCk = DEaccp.rsCom订购入库信息
Set rsOtCk = New Recordset
rsOtCk.CursorLocation = adUseClient
Set rsOtCk = ExecuteSQL(strsql)
Set cmdOtCk = New Command
Set rsQ = New Recordset
cmdOtCk.ActiveConnection = Module.ConnectString
cmdOtCk.CommandType = adCmdText
With rsOtCk
If .RecordCount <> 0 Then
.MoveFirst
While Not .EOF
strItem = !入库编号 & Space(20) & !入库日期
Me.LstDJ.AddItem strItem
.MoveNext
Wend
End If
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
rsOtCk.Close
Set rsOtCk = Nothing
Set cmdOtCk = Nothing
Set rsQ = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -