?? spdhd1.frm
字號:
'****************************************************
Msg = "當前商品需要存入貨單中嗎?" ' 定義信息。
Style = vbYesNo + vbInformation + vbDefaultButton2 ' 定義按鈕。
Title = "提示" ' 定義標題。
Ctxt = 1000 ' 定義標題
' 上下文。
' 顯示信息。
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' 用戶按下“是”。
Combo1.Text = shang
MyString = "Yes" ' 完成某操作。
Call Command3_Click
'czrygl.Data1.Recordset.MoveNext
'On Error GoTo endthis
'zyxx.Data1.Recordset.Delete
'zyxx.Data1.Refresh
'zyxx.Hide
'Call Form_Activate
'zyxx.Show
Else ' 用戶按下“否”。
MyString = "No" ' 完成某操作。
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")
bc = False
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Data1.Recordset.FindFirst "spmc = " & "'" & Combo1.Text & "'"
If Data1.Recordset.NoMatch = True Then
MsgBox "商品信息庫中沒有此商品,請先錄入。", vbInformation, " 提示"
Exit Sub
End If
Text9.Text = Data1.Recordset("spbh")
Text3.Text = Data1.Recordset("dw")
Text10.Text = Data1.Recordset("ghs")
End If
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 = "00000000" & (Val(Data2.Recordset("ddbh")) + 1)
If (Val(Data2.Recordset("ddbh")) + 1) >= 9 And (Val(Data2.Recordset("ddbh")) + 1) < 100 Then
Text1.Text = "0000000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 99 And (Val(Data2.Recordset("ddbh")) + 1) < 1000 Then
Text1.Text = "000000" + (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 999 And (Val(Data2.Recordset("ddbh")) + 1) < 10000 Then
Text1.Text = "00000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 9999 And (Val(Data2.Recordset("ddbh")) + 1) < 100000 Then
Text1.Text = "0000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 99999 And (Val(Data2.Recordset("ddbh")) + 1) < 1000000 Then
Text1.Text = "000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 999999 And (Val(Data2.Recordset("ddbh")) + 1) < 10000000 Then
Text1.Text = "00" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 9999999 And (Val(Data2.Recordset("ddbh")) + 1) < 100000000 Then
Text1.Text = "0" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) >= 99999999 And (Val(Data2.Recordset("ddbh")) + 1) < 1000000000 Then
Text1.Text = (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
Combo1.Text = ""
Text9.Text = ""
Text3.Text = ""
Text10.Text = ""
Text5.Text = ""
Text6.Text = ""
Text8.Text = ""
Text7.Text = ""
Text15.Text = ""
Text16.Text = ""
Text18.Text = ""
Combo3.Text = ""
Text17.Text = ""
Text19.Text = ""
Text14.Text = ""
bc = False
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
Command1.ToolTipText = "添加訂貨單"
End Sub
Private Sub Command3_Click()
If Text16.Text = "0" Then
MsgBox " 應付帳款不能為空" & vbCrLf & vbCrLf & "請仔細察看填寫的數(shù)據(jù)。", vbCritical, "警告"
Text16.SetFocus
Exit Sub
End If
If Text17.Text = "" Then
MsgBox " 規(guī)格不能為空" & vbCrLf & vbCrLf & "若沒有規(guī)格請?zhí)?#039;無' .", vbCritical, "警告"
Text17.Text = "無"
Text17.SetFocus
Exit Sub
End If
If Len(Text18.Text) > 50 Then
MsgBox "備注不要多于25個字", vbCritical, "警告"
Text18.SetFocus
Exit Sub
End If
'訂單保存
Data2.Recordset.FindFirst "ddbh = " & "'" & Text1.Text & "'"
If Data2.Recordset.NoMatch = True Then
If xgorbc = False Then
Data2.Recordset.AddNew
Else
Data2.Recordset.Edit
End If
Data2.Recordset("ddbh") = Trim(Text1.Text)
Data2.Recordset("dingjin") = Val(Combo3.Text)
Data2.Recordset("jsr") = Label3.Caption
Data2.Recordset("ljje") = Val(Text16.Text) - Val(Text19.Text)
Data2.Recordset("lrrq") = Text2.Text
Data2.Recordset("dhrq") = DTPicker2.Value
Data2.Recordset.Update
Data2.Refresh
Else
Data2.Recordset.Edit
Data2.Recordset("ljje") = Data2.Recordset("ljje") + (Val(Text16.Text) - Val(Text19.Text))
Data2.Recordset.Update
Data2.Refresh
MSFlexGrid.TextMatrix(0, 1) = " 訂單編號"
MSFlexGrid.TextMatrix(0, 2) = " 經(jīng)手人"
MSFlexGrid.TextMatrix(0, 5) = " 定金"
MSFlexGrid.TextMatrix(0, 3) = "錄入日期"
MSFlexGrid.TextMatrix(0, 4) = "到貨日期"
MSFlexGrid.TextMatrix(0, 6) = " 累計金額"
MSFlexGrid.TextMatrix(0, 7) = "供貨商"
MSFlexGrid.TextMatrix(0, 7) = "是否入庫"
'Exit Sub
End If
'商品保存
Data4.Recordset.AddNew
Data4.Recordset("dhdbh") = Text1.Text
Data4.Recordset("spbh") = Combo1.Text
Data4.Recordset("gg") = Text17.Text
Data4.Recordset("sl") = Val(Text14.Text)
Data4.Recordset("bz") = Text18.Text
Data4.Recordset("yfje") = Val(Text16.Text)
Data4.Recordset("zk") = Text19.Text
Data4.Recordset("dj") = Val(Text15.Text)
Data4.Recordset.Update
Data4.Refresh
'Unload Me
'zyxx.Show
MSFlexGrid.TextMatrix(0, 1) = " 訂單編號"
MSFlexGrid.TextMatrix(0, 2) = " 經(jīng)手人"
MSFlexGrid.TextMatrix(0, 5) = " 定金"
MSFlexGrid.TextMatrix(0, 3) = "錄入日期"
MSFlexGrid.TextMatrix(0, 4) = "到貨日期"
MSFlexGrid.TextMatrix(0, 6) = " 累計金額"
MSFlexGrid.TextMatrix(0, 7) = "是否入庫"
bc = True
xgorbc = False
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Dim incount As Integer
Dim jj, ll, je As Variant
Data2.Recordset.MoveLast
incount = Data2.Recordset.RecordCount
Data2.Recordset.MoveFirst
For i = 0 To 200
Combo3.AddItem i * 100
Next
Data2.Refresh
' 自動生成科目編號
Data2.Recordset.MoveFirst
Data2.Recordset.MoveLast
If (Val(Data2.Recordset("ddbh")) + 1) <= 9 Then Text1.Text = "00000000" & (Val(Data2.Recordset("ddbh")) + 1)
If (Val(Data2.Recordset("ddbh")) + 1) > 9 And (Val(Data2.Recordset("ddbh")) + 1) < 100 Then
Text1.Text = "0000000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) > 99 And (Val(Data2.Recordset("ddbh")) + 1) < 1000 Then
Text1.Text = "000000" + (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) > 999 And (Val(Data2.Recordset("ddbh")) + 1) < 10000 Then
Text1.Text = "00000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) > 9999 And (Val(Data2.Recordset("ddbh")) + 1) < 100000 Then
Text1.Text = "0000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) > 99999 And (Val(Data2.Recordset("ddbh")) + 1) < 1000000 Then
Text1.Text = "000" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) > 999999 And (Val(Data2.Recordset("ddbh")) + 1) < 10000000 Then
Text1.Text = "00" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) > 9999999 And (Val(Data2.Recordset("ddbh")) + 1) < 100000000 Then
Text1.Text = "0" & (Val(Data2.Recordset("ddbh")) + 1)
End If
If (Val(Data2.Recordset("ddbh")) + 1) > 99999999 And (Val(Data2.Recordset("ddbh")) + 1) < 1000000000 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
Combo1.AddItem Data1.Recordset("spmc")
Data1.Recordset.MoveNext
Next
Data1.Recordset.MoveFirst
'載入經(jīng)手人
Data3.Recordset.MoveLast
zycount = Data3.Recordset.RecordCount
Data3.Recordset.MoveFirst
Data3.Recordset.MoveNext
Data3.Recordset.MoveFirst
MSFlexGrid.ColWidth(0) = 200
MSFlexGrid.ColWidth(1) = 1500
MSFlexGrid.ColWidth(2) = 1200
MSFlexGrid.ColWidth(3) = 1300
MSFlexGrid.TextMatrix(0, 1) = " 訂單編號"
MSFlexGrid.TextMatrix(0, 2) = " 經(jīng)手人"
MSFlexGrid.TextMatrix(0, 5) = " 定金"
MSFlexGrid.TextMatrix(0, 3) = "錄入日期"
MSFlexGrid.TextMatrix(0, 4) = "到貨日期"
MSFlexGrid.TextMatrix(0, 6) = " 累計金額"
MSFlexGrid.TextMatrix(0, 7) = "是否入庫"
xgorbc = False
End Sub
Private Sub Form_Load()
DTPicker2.Value = Date
Text2.Text = Date
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from spxx"
Data2.DatabaseName = App.Path & "\db1.mdb"
Data2.RecordSource = "select * from spdhd"
Data3.DatabaseName = App.Path & "\db1.mdb"
Data3.RecordSource = "select * from zyzl"
Data4.DatabaseName = App.Path & "\db1.mdb"
Data4.RecordSource = "select * from dhdsp"
Label3.Caption = dlm
End Sub
Private Sub Label3_Click()
Call jinggao
End Sub
Private Sub MSFlexGrid_Click()
dj = 1
c = spdhd1.MSFlexGrid.Row
End Sub
Private Sub Text14_Change()
shang = Combo1.Text
End Sub
Private Sub Text15_GotFocus()
shang = Combo1.Text
End Sub
Private Sub Text16_Click()
Text16.Text = Val(Text15.Text) * Val(Text14.Text)
End Sub
Private Sub Text17_GotFocus()
shang = Combo1.Text
End Sub
Private Sub Text2_Click()
Call jinggao
End Sub
Sub jinggao()
MsgBox "不能修改! ", vbInformation, "提示"
Text17.SetFocus
End Sub
Private Sub Text3_Click()
Call jinggao
End Sub
Private Sub Text9_Click()
Call jinggao
End Sub
Private Sub Text10_Click()
Call jinggao
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -