📄 spxhth.frm
字号:
GridLines = 3
AllowUserResizing= 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
End
Attribute VB_Name = "spxhth"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public dj, c As Integer
Public xgorbc As Boolean
Public bc As Boolean
Private Sub Combo1_Change()
'data1.Recordset.FindFirst
End Sub
Private Sub Combo1_Click()
Data1.Recordset.FindFirst "spbh = " & "'" & Combo1.Text & "'"
Text9.Text = Data1.Recordset("spmc")
Text3.Text = Data1.Recordset("dw")
Text10.Text = Data1.Recordset("ghs")
Data6.Recordset.FindFirst "spbh = " & "'" & Combo1.Text & "'"
endthis:
If Data6.Recordset("ddbh") = MSFlexGrid.TextMatrix(c, 1) Then
'Text7.Text = Data6.Recordset("gg")
Text13.Text = Data6.Recordset("dj")
Text14.Text = Data6.Recordset("sl")
Exit Sub
Else
Data6.Recordset.FindNext "spbh = " & "'" & MSFlexGrid.TextMatrix(c, 1) & "'"
GoTo endthis
End If
End Sub
Private Sub Combo2_Click()
Text4.SetFocus
End Sub
Private Sub Command1_Click()
If bc = False Then
MsgBox "请先将当前记录保存。", vbCritical, "警告"
Exit Sub
End If
Data2.Recordset.MoveLast
If (Val(Data2.Recordset("ddbh")) + 1) < 9 Then Text1.Text = "000000000" & (Val(Data2.Recordset("ddbh")) + 1)
If (Val(Data2.Recordset("ddbh")) + 1) >= 9 And (Val(Data2.Recordset("ddbh")) + 1) < 100 Then
Text1.Text = "00000000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 99 And (Val(Data2.Recordset("ddbh")) + 1) < 1000 Then
Text1.Text = "0000000" + (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 999 And (Val(Data2.Recordset("ddbh")) + 1) < 10000 Then
Text1.Text = "000000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 9999 And (Val(Data2.Recordset("ddbh")) + 1) < 100000 Then
Text1.Text = "00000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 99999 And (Val(Data2.Recordset("ddbh")) + 1) < 1000000 Then
Text1.Text = "0000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 999999 And (Val(Data2.Recordset("ddbh")) + 1) < 10000000 Then
Text1.Text = "000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 9999999 And (Val(Data2.Recordset("ddbh")) + 1) < 100000000 Then
Text1.Text = "00" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 99999999 And (Val(Data2.Recordset("ddbh")) + 1) < 1000000000 Then
Text1.Text = "0" & (Val(Data2.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
Text9.Text = ""
Text3.Text = ""
Text10.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text8.Text = ""
Text7.Text = ""
bc = False
End Sub
Private Sub Command2_Click()
czxsd.Show
'If dj = 1 Then
' Data2.Recordset.FindFirst "ddbh = " & "'" & MSFlexGrid.TextMatrix(c, 1) & "'"
' Text1.Text = Data2.Recordset("ddbh")
' Combo1.Text = Data2.Recordset("spbh")
' Combo2.Text = Data2.Recordset("jsren")
' Text4.Text = Data2.Recordset("jhdj")
' Text2.Text = Data2.Recordset("sl")
' Text5.Text = Data2.Recordset("je")
' On Error Resume Next
' Text7.Text = Data2.Recordset("gg")
' Text6.Text = Data2.Recordset("kw")
' Text8.Text = Data2.Recordset("bz")
' DTPicker1.Value = Data2.Recordset("lrrq")
' DTPicker2.Value = Data2.Recordset("dhrq")
' 'DDTPicker2.Value = Data2.Recordset("dhrq")
' Data1.Recordset.FindFirst "spbh = " & "'" & MSFlexGrid.TextMatrix(c, 2) & "'"
' Text9.Text = Data1.Recordset("spmc")
' Text3.Text = Data1.Recordset("dw")
' Text10.Text = Data1.Recordset("ghs")
' Text11.Text = Data1.Recordset("ys")
' dj = 0
' xgorbc = True
' Else
' MsgBox "请先选择好要修改的对象。", vbInformation, "提示"
' Exit Sub
' End If
End Sub
Private Sub Command3_Click()
Text4.SetFocus
Data4.Recordset.AddNew
Data4.Recordset("thdbh") = Text1.Text
Data4.Recordset("spbh") = Combo1.Text
Data4.Recordset("thsy") = Val(Text12.Text)
Data4.Recordset("thrq") = Date
Data4.Recordset("thje") = Text5.Text
Data4.Recordset("bz") = Text8.Text
Data4.Recordset("thsl") = Val(Text2.Text)
Data4.Recordset("thdj") = Text4.Text
Data4.Recordset("jsr") = Label11.Caption
Data4.Recordset.Update
Data4.Refresh
'Data2.Recordset.Delete
'Data2.Refresh
Data5.Recordset.FindFirst "spbh = " & "'" & Combo1.Text & "'"
endthis:
If Data5.Recordset("gg") = Text7.Text Then
If Data5.Recordset("kcsl") = Val(Text2.Text) Then
Data5.Recordset.Delete
Data5.Refresh
Else
Data5.Recordset.Edit
Data5.Recordset("kcsl") = Data5.Recordset("kcsl") + Val(Text2.Text)
Data5.Recordset.Update
Data5.Refresh
End If
MsgBox "库存数量已成功增加。", vbInformation, "提示"
Else
Data5.Recordset.FindNext "spbh = " & "'" & Combo1.Text & "'"
GoTo endthis
' Data5.Recordset.FindFirst "spbh = " & "'" & Combo1.Text & "'"
'GoTo endthis
End If
Text1.Text = ""
Combo1.Text = ""
Text4.Text = ""
Text2.Text = ""
Text5.Text = ""
On Error Resume Next
Text7.Text = ""
Text8.Text = ""
DTPicker1.Value = 0
DTPicker2.Value = 0
Text9.Text = ""
Text3.Text = ""
Text10.Text = ""
MSFlexGrid.TextMatrix(0, 1) = " 订单编号"
MSFlexGrid.TextMatrix(0, 4) = " 经手人"
MSFlexGrid.TextMatrix(0, 2) = "录入日期"
MSFlexGrid.TextMatrix(0, 3) = "发货日期"
MSFlexGrid.TextMatrix(0, 5) = " 销货商"
MSFlexGrid.TextMatrix(0, 6) = "累计金额"
MSFlexGrid.TextMatrix(0, 7) = " 定金 "
MSFlexGrid.TextMatrix(0, 8) = "是否出库 "
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command5_Click()
'Data2.Recordset("zk") = 90
End Sub
Private Sub Dir1_Click()
End Sub
Private Sub Form_Activate()
'Combo1.DataField = "spbh"
'Data2.Recordset.Update
'Dim incount As Integer
'Dim jj, ll, je As Variant
'Data2.Recordset.MoveLast
'incount = Data2.Recordset.RecordCount
'Data2.Recordset.MoveFirst
'Data2.Recordset.Edit
'For i = 1 To incount
' jj = Data2.Recordset("jhdj")
' ll = Data2.Recordset("sl")
' je = Data2.Recordset("je")
' Data2.Recordset.Edit
' Data2.Recordset("zk") = jj * ll - je
' Data2.Recordset.Update
' Data2.Recordset.MoveNext
'
'Next
' ' Data2.Recordset.Update
' Data2.Refresh
'Text1.Text = Data2.Recordset("ddbh")
'Combo1.Text = Data2.Recordset("spbh")
' Combo2.Text = Data2.Recordset("jsren")
'Text4.Text = Data2.Recordset("jhdj")
'Text2.Text = Data2.Recordset("sl")
'Text5.Text = Data2.Recordset("je")
On Error Resume Next
'Text8.Text = Data2.Recordset("bz")
'DTPicker1.Value = Data2.Recordset("lrrq")
'DTPicker2.Value = Data2.Recordset("dhrq")
'DDTPicker2.Value = Data2.Recordset("dhrq")
' Data1.Recordset.FindFirst "spbh = " & "'" & MSFlexGrid.TextMatrix(c, 2) & "'"
'Text9.Text = Data1.Recordset("spmc")
'Text3.Text = Data1.Recordset("dw")
'Text10.Text = Data1.Recordset("ghs")
'Text11.Text = Data1.Recordset("ys") ''载入商品编号
'载入经手人
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
MSFlexGrid.ColWidth(0) = 200
MSFlexGrid.ColWidth(1) = 1500
MSFlexGrid.ColWidth(2) = 1200
MSFlexGrid.ColWidth(3) = 1300
MSFlexGrid.ColWidth(5) = 1800
MSFlexGrid.ColWidth(7) = 1500
MSFlexGrid.TextMatrix(0, 1) = " 订单编号"
MSFlexGrid.TextMatrix(0, 4) = " 经手人"
'MSFlexGrid.TextMatrix(0, 3) = " 商品编号"
MSFlexGrid.TextMatrix(0, 2) = "录入日期"
MSFlexGrid.TextMatrix(0, 3) = "发货日期"
'MSFlexGrid.TextMatrix(0, 6) = " 规格"
MSFlexGrid.TextMatrix(0, 5) = " 销货商"
'MSFlexGrid.TextMatrix(0, 8) = "数量 "
MSFlexGrid.TextMatrix(0, 6) = "累计金额"
MSFlexGrid.TextMatrix(0, 7) = " 定金 "
MSFlexGrid.TextMatrix(0, 8) = "是否出库 "
'MSFlexGrid.TextMatrix(0, 12) = "备注 "
xgorbc = False
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from spxx"
Data2.DatabaseName = App.Path & "\db1.mdb"
Data2.RecordSource = "select * from xhdd where xhdd.sfck = 1 "
Data3.DatabaseName = App.Path & "\db1.mdb"
Data3.RecordSource = "select * from zyzl"
Data4.DatabaseName = App.Path & "\db1.mdb"
Data4.RecordSource = "select * from xhth"
Data5.DatabaseName = App.Path & "\db1.mdb"
Data5.RecordSource = "select * from kczk"
Data6.DatabaseName = App.Path & "\db1.mdb"
Data6.RecordSource = "select * from xhdsp"
Text9.Enabled = False
Text3.Enabled = False
Text10.Enabled = False
'DTPicker1.Enabled = False
'DTPicker2.Enabled = False
Combo1.Enabled = True
Label11.Caption = dlm
Label11.Enabled = False
End Sub
Private Sub Label17_Click()
'Debug.Print Date
End Sub
Private Sub MSFlexGrid_Click()
dj = 1
c = spxhth.MSFlexGrid.Row
Data6.RecordSource = "select * from xhdsp where ddbh = '" & MSFlexGrid.TextMatrix(c, 1) & "'"
Data6.Refresh
Data6.Recordset.MoveLast
aa = Data6.Recordset.RecordCount
Data6.Recordset.MoveFirst
Combo1.Clear
For i = 1 To aa
'If Data6.Recordset("ddbh") = Then
Combo1.AddItem Data6.Recordset("spbh")
' End If
Data6.Recordset.MoveNext
Next
Data2.Recordset.FindFirst "ddbh = " & "'" & MSFlexGrid.TextMatrix(c, 1) & "'"
Text1.Text = Data2.Recordset("ddbh")
' Combo1.Text = Data2.Recordset("spbh")
' Combo2.Text = Data2.Recordset("jsren")
' Text4.Text = Data2.Recordset("jhdj")
' Text2.Text = Data2.Recordset("sl")
' Text5.Text = Data2.Recordset("je")
On Error Resume Next
If Data2.Recordset("gg") <> "" Then
Text7.Text = Data2.Recordset("gg")
Else
Text7.Text = ""
End If
' Text6.Text = Data2.Recordset("kw")
Text8.Text = Data2.Recordset("bz")
DTPicker1.Value = Data2.Recordset("lrrq")
DTPicker2.Value = Data2.Recordset("fhrq")
'DDTPicker2.Value = Data2.Recordset("dhrq")
'Data1.Recordset.FindFirst "spbh = " & "'" & MSFlexGrid.TextMatrix(c, 3) & "'"
' Text9.Text = Data1.Recordset("spmc")
' If Text3.Text <> "" Then
' Text3.Text = Data1.Recordset("dw")
'Else
' Text3.Text = ""
'End If
'Text10.Text = Data1.Recordset("ghs")
'Text11.Text = Data1.Recordset("ys")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -