📄 frmaddout.frm
字号:
Width = 615
End
Begin VB.Label Label4
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "订单票号"
Height = 255
Left = 240
TabIndex = 25
Top = 1320
Width = 735
End
Begin VB.Label Label8
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "客户"
Height = 255
Left = 2640
TabIndex = 23
Top = 2280
Width = 675
End
Begin VB.Label Label17
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "日"
Height = 255
Left = 6720
TabIndex = 21
Top = 780
Width = 195
End
Begin VB.Label Label16
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "月"
Height = 255
Left = 6120
TabIndex = 20
Top = 780
Width = 195
End
Begin VB.Label Label15
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "年"
Height = 255
Left = 5520
TabIndex = 19
Top = 780
Width = 255
End
Begin VB.Line Line13
X1 = 3420
X2 = 3420
Y1 = 1140
Y2 = 2640
End
Begin VB.Line Line10
X1 = 2340
X2 = 2340
Y1 = 1140
Y2 = 2640
End
Begin VB.Line Line9
X1 = 1080
X2 = 1080
Y1 = 1140
Y2 = 3840
End
Begin VB.Label label13
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "产品名称"
Height = 255
Left = 2520
TabIndex = 18
Top = 1320
Width = 735
End
Begin VB.Line Line14
X1 = 180
X2 = 6900
Y1 = 2580
Y2 = 2580
End
Begin VB.Label Label12
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "金额"
Height = 255
Left = 360
TabIndex = 17
Top = 2280
Width = 435
End
Begin VB.Line Line8
X1 = 180
X2 = 6900
Y1 = 2100
Y2 = 2100
End
Begin VB.Line Line7
X1 = 180
X2 = 6900
Y1 = 1620
Y2 = 1620
End
Begin VB.Line Line6
BorderWidth = 2
X1 = 6900
X2 = 6900
Y1 = 1140
Y2 = 3840
End
Begin VB.Line Line5
BorderWidth = 2
X1 = 180
X2 = 180
Y1 = 1140
Y2 = 3840
End
Begin VB.Line Line4
X1 = 2460
X2 = 4500
Y1 = 600
Y2 = 600
End
Begin VB.Line Line3
BorderWidth = 2
X1 = 240
X2 = 6960
Y1 = 4200
Y2 = 4200
End
Begin VB.Line Line2
BorderWidth = 2
X1 = 180
X2 = 6900
Y1 = 3840
Y2 = 3840
End
Begin VB.Line Line1
BorderWidth = 2
X1 = 180
X2 = 6900
Y1 = 1140
Y2 = 1140
End
Begin VB.Label Label10
AutoSize = -1 'True
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "备注"
Height = 180
Left = 360
TabIndex = 16
Top = 2880
Width = 360
End
Begin VB.Label Label7
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "数量"
Height = 255
Left = 2760
TabIndex = 14
Top = 1800
Width = 435
End
Begin VB.Label Label5
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "货名规格"
Height = 255
Left = 240
TabIndex = 13
Top = 1800
Width = 795
End
Begin VB.Label Label3
Appearance = 0 'Flat
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "日期:"
ForeColor = &H80000008&
Height = 255
Left = 4320
TabIndex = 12
Top = 780
Width = 495
End
Begin VB.Label Label2
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "出 库 单"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 11
Top = 180
Width = 1935
End
Begin VB.Label Label1
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "编号:"
Height = 255
Left = 300
TabIndex = 10
Top = 780
Width = 495
End
End
Attribute VB_Name = "FrmAddOut"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
TxtYear = Year(Date)
TxtM = Month(Date)
TxtD = Day(Date)
Adodc1.ConnectionString = conn
Adodc1.RecordSource = "select * from outstore"
Adodc1.Refresh
If Not Adodc1.Recordset.EOF Then
csql = "select max(出库单号) from outstore"
Adodc1.RecordSource = csql
Adodc1.Refresh
TxtON = Val(Adodc1.Recordset(0)) + 1
Else
TxtON = 1
End If
TxtON.Text = Right(CStr(100000), 5) + TxtON
Adodc2.ConnectionString = conn
Adodc2.RecordSource = "select * from store"
AdoOrder.ConnectionString = conn
AdoOrder.RecordSource = "select * from ddxx"
AdoOrder.Refresh
End Sub
Private Sub TxtOr_Change()
AdoOrder.RecordSource = "select * from ddxx where 订单号 like '" & TxtOr & "'"
AdoOrder.Refresh
If AdoOrder.Recordset.RecordCount <> 0 Then
TxtOut(0) = AdoOrder.Recordset("商品名称")
TxtOut(3) = AdoOrder.Recordset("数量")
TxtOut(4) = AdoOrder.Recordset("金额")
TxtOut(5) = AdoOrder.Recordset("订货客户")
End If
End Sub
Private Sub 保存_Click()
For i = 2 To 5
If TxtOut(i) = "" Then
MsgBox "请输入完整信息!", vbCritical + vbOKOnly, "警告"
Exit Sub
End If
Next
Adodc2.RecordSource = "select * from store where 产品名称 like '" & TxtOut(0) & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
MsgBox "无此产品,请确定产品编号输入无误!", vbCritical + vbOKOnly, "警告"
TxtOut(0).SetFocus
Exit Sub
End If
Adodc1.RecordSource = "select * from outstore"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset(0) = TxtON
Adodc1.Recordset(7) = Date
Adodc1.Recordset(2) = TxtOut(0)
Adodc1.Recordset(1) = TxtOr
For i = 3 To 4
Adodc1.Recordset(i + 2) = TxtOut(i)
Next
Adodc1.Recordset(8) = TxtOut(6)
Adodc1.Recordset.Update
Adodc1.Refresh
Adodc2.Recordset("数量") = Adodc2.Recordset("数量") - Val(Trim(TxtOut(3)))
Adodc2.Recordset.Update
Adodc2.Refresh
If AdoOrder.Recordset.RecordCount = 0 Then
MsgBox "请输入正确的订单票号!", vbCritical + vbOKOnly, "警告"
TxtOut(1).SetFocus
Exit Sub
End If
AdoOrder.Recordset("订单状态") = "已发货"
AdoOrder.Recordset.Update
MsgBox "保存成功!", vbInformation + vbOKOnly, "提示"
保存.Enabled = False
End Sub
Private Sub 打印_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -