📄 frmxsck.frm
字号:
VERSION 5.00
Object = "{4406B9AC-521E-476B-AF25-3D2C36110576}#3.0#0"; "CommandSCE.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmxsck
BorderStyle = 1 'Fixed Single
Caption = "销售出库"
ClientHeight = 4965
ClientLeft = 45
ClientTop = 435
ClientWidth = 8265
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4965
ScaleWidth = 8265
StartUpPosition = 2 '屏幕中心
Begin CSCommandSCE.CommandSCE CommandSCE2
Height = 375
Left = 6480
TabIndex = 21
Top = 4320
Width = 1215
_ExtentX = 2143
_ExtentY = 661
IconAlign = 0
Icon = "frmxsck.frx":0000
Caption = "关闭"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin CSCommandSCE.CommandSCE CommandSCE1
Height = 375
Left = 5040
TabIndex = 20
Top = 4320
Width = 1215
_ExtentX = 2143
_ExtentY = 661
IconAlign = 0
Icon = "frmxsck.frx":001C
Caption = "确定"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Frame Frame2
Caption = "输入"
Height = 1815
Left = 240
TabIndex = 1
Top = 2160
Width = 7815
Begin VB.TextBox Text6
Height = 270
Left = 5520
TabIndex = 19
Top = 720
Width = 975
End
Begin VB.TextBox Text5
Height = 270
Left = 4080
TabIndex = 18
Top = 720
Width = 1095
End
Begin VB.TextBox Text4
Height = 270
Left = 2880
TabIndex = 17
Top = 720
Width = 975
End
Begin VB.TextBox Text3
Height = 270
Left = 1560
TabIndex = 16
Top = 720
Width = 1095
End
Begin VB.ComboBox Combo3
Height = 300
Left = 240
TabIndex = 15
Top = 720
Width = 1095
End
Begin VB.Label Label2
Caption = "金额"
Height = 255
Index = 4
Left = 5640
TabIndex = 10
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "单价"
Height = 255
Index = 3
Left = 4320
TabIndex = 9
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "数量"
Height = 255
Index = 2
Left = 3000
TabIndex = 8
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "商品名称"
Height = 255
Index = 1
Left = 1680
TabIndex = 7
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "商品代码"
Height = 255
Index = 0
Left = 360
TabIndex = 6
Top = 360
Width = 975
End
End
Begin VB.Frame Frame1
Caption = "信息"
Height = 1935
Left = 240
TabIndex = 0
Top = 120
Width = 7815
Begin VB.TextBox Text1
Height = 270
Left = 6480
TabIndex = 24
Top = 240
Width = 1095
End
Begin VB.TextBox Text7
Height = 375
Left = 4200
TabIndex = 23
Top = 960
Width = 3255
End
Begin VB.TextBox Text2
Height = 375
Left = 960
TabIndex = 14
Top = 960
Width = 2175
End
Begin MSComCtl2.DTPicker DTp1
Height = 255
Left = 4560
TabIndex = 13
Top = 240
Width = 1215
_ExtentX = 2143
_ExtentY = 450
_Version = 393216
Format = 61931521
CurrentDate = 38237
End
Begin VB.ComboBox Combo2
Height = 300
Left = 2880
TabIndex = 12
Top = 240
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 300
Left = 840
TabIndex = 11
Top = 240
Width = 1095
End
Begin VB.Label Label4
Caption = "订单号"
Height = 255
Left = 5760
TabIndex = 25
Top = 360
Width = 615
End
Begin VB.Label Label3
Caption = "销售单号"
Height = 255
Left = 3360
TabIndex = 22
Top = 1080
Width = 735
End
Begin VB.Label Label1
Caption = "发票号"
Height = 255
Index = 4
Left = 360
TabIndex = 5
Top = 1080
Width = 735
End
Begin VB.Label Label1
Caption = "日期"
Height = 255
Index = 2
Left = 4080
TabIndex = 4
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "经手人"
Height = 255
Index = 1
Left = 2160
TabIndex = 3
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "客户"
Height = 255
Index = 0
Left = 360
TabIndex = 2
Top = 360
Width = 735
End
End
End
Attribute VB_Name = "frmxsck"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo3_Click()
Dim sqltxt As String
Dim msgtxt As String
Dim mrc As ADODB.Recordset
sqltxt = "select spmc from sp where spdm='" & Combo3.Text & "'"
Set mrc = ExecuteSQL(sqltxt, msgtxt)
Text3.Text = mrc.Fields(0)
mrc.Close
End Sub
Private Sub CommandSCE1_Click()
Dim i As Integer
Dim sqltxt As String
Dim msgtxt As String
Dim mrc As ADODB.Recordset
sqltxt = "select * from xs"
Set mrc = ExecuteSQL(sqltxt, msgtxt)
With mrc
.AddNew
.Fields(0) = Trim(Combo1.Text)
.Fields(1) = Trim(Text7.Text)
.Fields(2) = Trim(Text1.Text)
.Fields(3) = Val(Text6.Text)
.Fields(4) = DTP1.Value
.Fields(5) = Trim(Combo2.Text)
.Fields(6) = Trim(Text2.Text)
.Update
End With
sqltxt = "select kcsl from kc where dm='" & Combo3.Text & "'"
Set mrc = ExecuteSQL(sqltxt, msgtxt)
mrc.Fields(0) = mrc.Fields(0) - Val(Text4.Text)
mrc.Update
mrc.Close
MsgBox "成功!"
With Main.et5
.Cols = 8
.TextMatrix(0, 1) = "客户"
.TextMatrix(0, 2) = "销售单"
.TextMatrix(0, 3) = "订单号"
.TextMatrix(0, 4) = "金额"
.TextMatrix(0, 5) = "销售日期"
.TextMatrix(0, 6) = "经手人"
.TextMatrix(0, 7) = "发票号"
.FixedRows = 1
'设置各列对齐方式
For i = 0 To 7
.ColAlignment(i) = 0
Next i
'表头项居中
'.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
End With
'***************************************************************8
'eg2.Clear
sqltxt = "select * from xs"
Set rst = ExecuteSQL(sqltxt, msgtxt)
If rst.RecordCount < 1 Then
MsgBox "没有查询到相应信息!", vbOKOnly + vbExclamation, "查询"
Exit Sub
End If
If rst.EOF = False Then
With Main.et5
.Rows = 1
Do While Not rst.EOF
.Rows = .Rows + 1
For i = 1 To rst.Fields.Count
.TextMatrix(.Rows - 1, i) = rst.Fields(i - 1)
Next i
rst.MoveNext
Loop
End With
End If
rst.Close
Main.eg5.FixedRows = 1
End Sub
Private Sub CommandSCE2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
DTP1.Value = Date
Dim fsqltxt As String
Dim msgtxt As String
Dim mrc As ADODB.Recordset
fsqltxt = "select distinct khmc from kh"
Set mrc = ExecuteSQL(fsqltxt, msgtxt)
For i = 1 To mrc.RecordCount
Combo1.AddItem mrc.Fields(0)
mrc.MoveNext
Next i
mrc.Close
fsqltxt = "select distinct jsr from jsr"
Set mrc = ExecuteSQL(fsqltxt, msgtxt)
For i = 1 To mrc.RecordCount
Combo2.AddItem mrc.Fields(0)
mrc.MoveNext
Next i
mrc.Close
fsqltxt = "select distinct spdm from sp"
Set mrc = ExecuteSQL(fsqltxt, msgtxt)
For i = 1 To mrc.RecordCount
Combo3.AddItem mrc.Fields(0)
mrc.MoveNext
Next i
mrc.Close
End Sub
Private Sub Text5_Change()
Text6.Text = Val(Text4.Text) * Val(Text5.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -