📄 spxhd.frm
字号:
'data1.Recordset.FindFirst
End Sub
Private Sub Combo1_Click()
If Val(Text5.Text) > 0 Then
MsgBox "当前商品还没有保存,是否需要保存?", vbYesNo + vbDefaultButton1 + vbInformation, "提示"
If vbYesNo = True Then
Combo1.Text = Text14.Text
Call Command3_Click
Exit Sub
Else
Text11.Text = Date
Text11.Text = Date
Combo4.Text = "0"
Text9.Text = ""
Text10.Text = ""
Text3.Text = ""
Text6.Text = ""
Text7.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text12.Text = ""
Text8.Text = ""
End If
End If
Data1.Recordset.FindFirst "spmc = " & "'" & Combo1.Text & "'"
Text9.Text = Data1.Recordset("spbh")
Text3.Text = Data1.Recordset("dw")
Text10.Text = Data1.Recordset("ghs")
Data2.Recordset.FindFirst "spbh= " & "'" & Combo1.Text & "'"
If Data2.Recordset.NoMatch Then
Text6.Text = "无货"
Else
Text6.Text = Data2.Recordset("kw")
End If
End Sub
Private Sub Combo2_Click()
Data1.Recordset.FindFirst "spmc = " & "'" & Combo1.Text & "'"
Text9.Text = Data1.Recordset("spbh")
Text3.Text = Data1.Recordset("dw")
Text10.Text = Data1.Recordset("ghs")
Data2.Recordset.FindFirst "spbh = " & "'" & Combo1.Text & "'"
If Data2.Recordset.NoMatch Then
Text6.Text = ""
Else
Text6.Text = Data2.Recordset("kw")
End If
Text7.SetFocus
End Sub
Private Sub Combo5_Change()
End Sub
Private Sub Command1_Click()
If bc = False Then
MsgBox "请先将当前记录保存。", vbCritical, "警告"
Exit Sub
End If
Data4.Recordset.MoveLast
If (Val(Data4.Recordset("ddbh")) + 1) < 9 Then Text1.Text = "00000000" & (Val(Data4.Recordset("ddbh")) + 1)
If (Val(Data4.Recordset("ddbh")) + 1) >= 9 And (Val(Data4.Recordset("ddbh")) + 1) < 100 Then
Text1.Text = "0000000" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 99 And (Val(Data4.Recordset("ddbh")) + 1) < 1000 Then
Text1.Text = "000000" + (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 999 And (Val(Data4.Recordset("ddbh")) + 1) < 10000 Then
Text1.Text = "00000" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 9999 And (Val(Data4.Recordset("ddbh")) + 1) < 100000 Then
Text1.Text = "0000" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 99999 And (Val(Data4.Recordset("ddbh")) + 1) < 1000000 Then
Text1.Text = "000" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 999999 And (Val(Data4.Recordset("ddbh")) + 1) < 10000000 Then
Text1.Text = "00" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 9999999 And (Val(Data4.Recordset("ddbh")) + 1) < 100000000 Then
Text1.Text = "0" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 99999999 And (Val(Data4.Recordset("ddbh")) + 1) < 1000000000 Then
Text1.Text = (Val(Data4.Recordset("ddbh")) + 1)
End If
' If (Val(Data4.Recordset("ddbh")) + 1) >= 999999999 And (Val(Data4.Recordset("ddbh")) + 1) < 10000000000# Then
' Text1.Text = Val(Data4.Recordset("ddbh")) + 1
' End If
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text8.Text = ""
Text7.Text = ""
Text9.Text = ""
Text10.Text = ""
Text3.Text = ""
Text6.Text = ""
Text2.Text = ""
Text12.Text = ""
bc = False
End Sub
Private Sub Command2_Click()
If dj = 1 Then
Data4.Recordset.FindFirst "ddbh = " & "'" & MSFlexGrid.TextMatrix(c, 1) & "'"
Text1.Text = Data4.Recordset("ddbh")
Combo1.Text = Data4.Recordset("spmc")
Label15.Caption = Data4.Recordset("jsr")
Text4.Text = Data4.Recordset("xhdj")
Text2.Text = Data4.Recordset("xhsl")
Text5.Text = Data4.Recordset("je")
On Error Resume Next
Text7.Text = Data4.Recordset("gg")
Combo3.Text = Data4.Recordset("xhs")
Text8.Text = Data4.Recordset("bz")
Text11.Text = Data4.Recordset("lrrq")
DTPicker2.Value = Data4.Recordset("fhrq")
Data1.Recordset.FindFirst "spbh = " & "'" & MSFlexGrid.TextMatrix(c, 3) & "'"
Text9.Text = Data1.Recordset("spbh")
Text3.Text = Data1.Recordset("dw")
Text10.Text = Data1.Recordset("ghs")
Data2.Recordset.FindFirst "spmc = " & "'" & Combo1.Text & "'"
If Data2.Recordset.NoMatch Then
Text6.Text = ""
Else
Text6.Text = Data2.Recordset("kw")
End If
dj = 0
xgorbc = True
Else
MsgBox "请先选择好要修改的对象。", vbInformation, "提示"
Exit Sub
End If
End Sub
Private Sub Command3_Click()
If Text2.Text = "0" Then
MsgBox " 单价不可能为 0 。", vbCritical, "警告"
Text2.SetFocus
Exit Sub
End If
If Text7.Text = "" Then
MsgBox " 规格不能为空" & vbCrLf & vbCrLf & "若没有规格请填'无' .", vbCritical, "警告"
Text7.Text = "无"
Text7.SetFocus
Exit Sub
End If
If Len(Text8.Text) > 50 Then
MsgBox "备注不要多于25个字", vbCritical, "警告"
Text8.SetFocus
Exit Sub
End If
'订货单添加
Data4.Recordset.FindFirst "ddbh= '" & Text1.Text & "'"
If Data4.Recordset.NoMatch Then
Data4.Recordset.AddNew
Data4.Recordset("ddbh") = Trim(Text1.Text)
Data4.Recordset("jsr") = Trim(Label15.Caption)
Data4.Recordset("dingjin") = Val(Combo4.Text)
Data4.Recordset("lrrq") = Text11.Text
Data4.Recordset("fhrq") = DTPicker2.Value
Data4.Recordset("sfck") = 0
Data4.Recordset("xhs") = Combo3.Text
Data4.Recordset("ljje") = Data4.Recordset("ljje") + Val(Text5.Text)
Data4.Recordset.Update
Data4.Refresh
End If
'商品添加
Data6.Recordset.AddNew
Data6.Recordset("ddbh") = Trim(Text1.Text)
Data6.Recordset("spbh") = Text14.Text
Data6.Recordset("gg") = Text7.Text
Data6.Recordset("sl") = Val(Text4.Text)
Data6.Recordset("dj") = Val(Text2.Text)
Data6.Recordset("ysje") = Val(Text5.Text)
Data6.Recordset("zk") = Val(Text12.Text)
Data6.Recordset("bz") = Text8.Text
Data6.Recordset.Update
Data6.Refresh
'Call Form_Activate
MSFlexGrid.TextMatrix(0, 1) = " 订单编号"
MSFlexGrid.TextMatrix(0, 2) = " 商品编号"
'MSFlexGrid.TextMatrix(0, 3) = " 规格"
MSFlexGrid.TextMatrix(0, 2) = "录入日期"
MSFlexGrid.TextMatrix(0, 3) = "发货日期"
'MSFlexGrid.TextMatrix(0, 6) = "发货单价 "
'MSFlexGrid.TextMatrix(0, 7) = "订货数量 "
MSFlexGrid.TextMatrix(0, 6) = "累计金额"
MSFlexGrid.TextMatrix(0, 8) = " 是否出库 "
MSFlexGrid.TextMatrix(0, 4) = "经手人 "
MSFlexGrid.TextMatrix(0, 5) = " 销货商"
MSFlexGrid.TextMatrix(0, 7) = "定金 "
xgorbc = False
Text11.Text = Date
Text11.Text = Date
Combo4.Text = "0"
Text9.Text = ""
Text10.Text = ""
Text3.Text = ""
Text6.Text = ""
Text7.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text12.Text = ""
Text8.Text = ""
'Unload Me
'zyxx.Show
bc = True
xgorbc = False
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text7.SetFocus
For i = 0 To 200
Combo4.AddItem i * 100
Next
' 自动生成科目编号
'Data2.Recordset.MoveFirst
Data4.Recordset.MoveLast
If (Val(Data4.Recordset("ddbh")) + 1) < 9 Then Text1.Text = "00000000" & (Val(Data4.Recordset("ddbh")) + 1)
If (Val(Data4.Recordset("ddbh")) + 1) >= 9 And (Val(Data4.Recordset("ddbh")) + 1) < 100 Then
Text1.Text = "0000000" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 99 And (Val(Data4.Recordset("ddbh")) + 1) < 1000 Then
Text1.Text = "000000" + (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 999 And (Val(Data4.Recordset("ddbh")) + 1) < 10000 Then
Text1.Text = "00000" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 9999 And (Val(Data4.Recordset("ddbh")) + 1) < 100000 Then
Text1.Text = "0000" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 99999 And (Val(Data4.Recordset("ddbh")) + 1) < 1000000 Then
Text1.Text = "000" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 999999 And (Val(Data4.Recordset("ddbh")) + 1) < 10000000 Then
Text1.Text = "00" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 9999999 And (Val(Data4.Recordset("ddbh")) + 1) < 100000000 Then
Text1.Text = "0" & (Val(Data4.Recordset("ddbh")) + 1)
End If
If (Val(Data4.Recordset("ddbh")) + 1) >= 99999999 And (Val(Data4.Recordset("ddbh")) + 1) < 1000000000 Then
Text1.Text = Val(Data4.Recordset("ddbh")) + 1
End If
'If (Val(Data2.Recordset("ddbh")) + 1) >= 999999999 And (Val(Data2.Recordset("ddbh")) + 1) < 10000000000# Then
'Text1.Text = Val(Data2.Recordset("ddbh")) + 1
'End If
'载入商品编号
Data1.Recordset.MoveLast
spbhcount = Data1.Recordset.RecordCount
Data1.Recordset.MoveFirst
For j = 1 To spbhcount - 1
Combo1.AddItem Data1.Recordset("spmc")
Data1.Recordset.MoveNext
Next
Data1.Recordset.MoveFirst
'载入经手人
Data3.Recordset.MoveLast
zycount = Data3.Recordset.RecordCount
Data3.Recordset.MoveFirst
Data3.Recordset.MoveNext
For k = 1 To zycount - 1
'Combo2.AddItem Data3.Recordset("xm")
Data3.Recordset.MoveNext
Next
Data3.Recordset.MoveFirst
Data5.Recordset.MoveLast
combo1count = Data5.Recordset.RecordCount
Data5.Recordset.MoveFirst
For p = 1 To combo1count
If Data5.Recordset("khlx") = "销货商" Then
Combo3.AddItem Data5.Recordset("dwmc")
End If
Data5.Recordset.MoveNext
Next
Data5.Recordset.MoveFirst
MSFlexGrid.ColWidth(0) = 200
MSFlexGrid.ColWidth(1) = 1500
MSFlexGrid.ColWidth(2) = 1500
MSFlexGrid.ColWidth(3) = 1300
'MSFlexGrid.ColWidth(7) = 1500
MSFlexGrid.ColWidth(6) = 1500
MSFlexGrid.TextMatrix(0, 1) = " 订单编号"
MSFlexGrid.TextMatrix(0, 2) = " 商品编号"
'MSFlexGrid.TextMatrix(0, 3) = " 规格"
MSFlexGrid.TextMatrix(0, 2) = "录入日期"
MSFlexGrid.TextMatrix(0, 3) = "发货日期"
'MSFlexGrid.TextMatrix(0, 6) = "发货单价 "
'MSFlexGrid.TextMatrix(0, 7) = "订货数量 "
MSFlexGrid.TextMatrix(0, 6) = "累计金额"
MSFlexGrid.TextMatrix(0, 8) = " 是否出库 "
MSFlexGrid.TextMatrix(0, 4) = "经手人 "
MSFlexGrid.TextMatrix(0, 5) = " 销货商"
MSFlexGrid.TextMatrix(0, 7) = "定金 "
xgorbc = False
Text11.Text = Date
Text11.Text = Date
End Sub
Private Sub Form_Initialize()
For i = 2 To 200
Combo4.AddItem i * 100
Next
End Sub
Private Sub Form_Load()
DTPicker2.Value = Date
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from spxx"
Data2.DatabaseName = App.Path & "\db1.mdb"
Data2.RecordSource = "select * from kczk"
Data3.DatabaseName = App.Path & "\db1.mdb"
Data3.RecordSource = "select * from zyzl"
Data4.DatabaseName = App.Path & "\db1.mdb"
Data4.RecordSource = "select * from xhdd"
Data5.DatabaseName = App.Path & "\db1.mdb"
Data5.RecordSource = "select * from wldw"
Data6.DatabaseName = App.Path & "\db1.mdb"
Data6.RecordSource = "select * from xhdsp"
Label15.Caption = dlm
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Frame4_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub MSFlexGrid_Click()
dj = 1
c = spxhd.MSFlexGrid.Row
End Sub
Private Sub Text1_Click()
Call jinggao
End Sub
Private Sub Text10_Click()
Call jinggao
Text14.Text = Combo1.Text
End Sub
Private Sub Text11_Click()
Call jinggao
End Sub
Private Sub Text2_Click()
Text14.Text = Combo1.Text
End Sub
Private Sub Text3_Click()
Call jinggao
Text14.Text = Combo1.Text
End Sub
Private Sub Text4_Click()
Text14.Text = Combo1.Text
End Sub
Private Sub Text5_Click()
Text5.Text = Val(Text2.Text) * Val(Text4.Text)
Text14.Text = Combo1.Text
End Sub
Private Sub VScroll1_Change()
End Sub
Sub jinggao()
MsgBox "不能修改! ", vbInformation, "提示"
Text7.SetFocus
End Sub
Private Sub Text6_Click()
Call jinggao
End Sub
Private Sub Text7_Click()
Text14.Text = Combo1.Text
End Sub
Private Sub Text9_Click()
Call jinggao
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -