sales_form.frm
来自「很好一套库存管理」· FRM 代码 · 共 1,955 行 · 第 1/5 页
FRM
1,955 行
Else
clear_box
MsgBox "All Items Deleted ...", vbInformation, "Items Deleted.."
End If
End If
OP_STATUS (True)
Else
clear_box
MsgBox "All Items Deleted ...", vbInformation, "Items Deleted.."
OP_STATUS (True)
End If
Call Combo4_Click
ElseIf Index = 3 Then
cmd.Enabled = False
ENABLE_DISABLE (True)
OP_STATUS (False)
If SALE_TYPE = "SYSTEM" Then
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
Else
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
End If
ElseIf Index = 4 Then
Status = False
rs_cur_record_count.Requery
rs_cur_invoice_item.CancelBatch
rs_cur_invoice_item.CancelUpdate
cmd.Enabled = True
If rs_cur_record_count.Fields(0).Value > 0 Then
rs_cur_invoice_item.MoveFirst
Else
clear_box
End If
Call OP_STATUS(True)
ENABLE_DISABLE (False)
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
cmd.Enabled = True
End If
End Sub
Private Sub Combo1_Change()
If Len(Combo1.Text) = 0 Then
LaVolpeButton2.Enabled = False
End If
End Sub
Private Sub Combo1_Click()
LaVolpeButton2.Enabled = True
Dim CUST_ID_RS As New ADODB.Recordset
CUST_ID_RS.Open "SELECT * FROM Customer_master WHERE cutomer_name='" & Combo1.Text & "'", db, adOpenDynamic, adLockOptimistic
Text1(4).Text = CUST_ID_RS.Fields(0).Value
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If Len(Combo1.Text) > 0 Then
If KeyCode = 13 Then
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
End If
End If
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Combo2_Click()
Text1(5).Text = Clear
Text1(6).Text = Clear
FILL_QTY (0)
Text1(2).Text = Clear
Text1(3).Text = Clear
'Combo4.Text = Clear
REFRESH_COMBO (4)
Combo5.Enabled = False
Text1(2).Enabled = False
REFRESH_COMBO (4)
Set DataGrid1.DataSource = Nothing
RS_PUR_ITEMS.Close
RS_PUR_ITEMS.CursorLocation = adUseClient
RS_PUR_ITEMS.Open "SELECT Invoice_no,Qty,price_per_unit,Purchase_Date FROM AVAILABLE_PURCHASED_STOCK WHERE Item_type='" & Combo3.Text & "' AND Item_name='" & Combo2.Text & "' AND Party_name='" & Combo4.Text & "'", db, adOpenDynamic, adLockOptimistic
Set DataGrid1.DataSource = RS_PUR_ITEMS
DataGrid1.Enabled = True
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If Len(Combo2.Text) > 0 Then
If KeyCode = 13 Then
SendKeys "{TAB}"
End If
End If
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
'KeyAscii = 0
End Sub
Private Sub Combo3_Click()
REFRESH_COMBO (2)
REFRESH_COMBO (4)
FILL_QTY (0)
Set DataGrid1.DataSource = Nothing
RS_PUR_ITEMS.Close
RS_PUR_ITEMS.CursorLocation = adUseClient
RS_PUR_ITEMS.Open "SELECT Invoice_no,Qty,price_per_unit,Purchase_Date FROM AVAILABLE_PURCHASED_STOCK WHERE Item_type='" & Combo3.Text & "' AND Item_name='" & Combo2.Text & "' AND Party_name='" & Combo4.Text & "'", db, adOpenDynamic, adLockOptimistic
Set DataGrid1.DataSource = RS_PUR_ITEMS
DataGrid1.Enabled = True
End Sub
Private Sub Combo3_KeyDown(KeyCode As Integer, Shift As Integer)
If Len(Combo3.Text) > 0 Then
If KeyCode = 13 Then
SendKeys "{TAB}"
End If
End If
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
'KeyAscii = 0
End Sub
Private Sub Combo4_Click()
FILL_QTY (0)
Set DataGrid1.DataSource = Nothing
RS_PUR_ITEMS.Close
RS_PUR_ITEMS.CursorLocation = adUseClient
RS_PUR_ITEMS.Open "SELECT Invoice_no,Qty,price_per_unit,Purchase_Date,Item_Description FROM AVAILABLE_PURCHASED_STOCK WHERE Item_type='" & Combo3.Text & "' AND Item_name='" & Combo2.Text & "' AND Party_name='" & Combo4.Text & "'", db, adOpenDynamic, adLockOptimistic
If RS_PUR_ITEMS.EOF <> True Then
Text1(5).Text = RS_PUR_ITEMS.Fields(1).Value
Text1(6).Text = RS_PUR_ITEMS.Fields(2).Value
If Len(Text1(5).Text) > 0 Then
Text1(2).Enabled = True
Combo5.Enabled = True
FILL_QTY (VAL(Text1(5).Text))
End If
End If
Set DataGrid1.DataSource = RS_PUR_ITEMS
DataGrid1.Enabled = True
Call DataGrid1_Click
End Sub
Private Sub Combo4_KeyDown(KeyCode As Integer, Shift As Integer)
If Len(Combo4.Text) > 0 Then
If KeyCode = 13 Then
SendKeys "{TAB}"
End If
End If
End Sub
Private Sub Combo4_KeyPress(KeyAscii As Integer)
' KeyAscii = 0
End Sub
Private Sub Combo5_Change()
If VAL(Combo5.Text) <> 0 And VAL(Text1(2).Text) <> 0 Then
Text1(3).Text = VAL(Combo5.Text) * VAL(Text1(2).Text)
Else
Text1(3).Text = Clear
End If
End Sub
Private Sub Combo5_Click()
If VAL(Combo5.Text) <> 0 And VAL(Text1(2).Text) <> 0 Then
Text1(3).Text = VAL(Combo5.Text) * VAL(Text1(2).Text)
Else
Text1(3).Text = Clear
End If
End Sub
Private Sub Combo5_KeyDown(KeyCode As Integer, Shift As Integer)
If Len(Combo5.Text) > 0 Then
If KeyCode = 13 Then
SendKeys "{TAB}"
End If
End If
End Sub
Private Sub Combo5_KeyPress(KeyAscii As Integer)
'KeyAscii = 0
End Sub
Private Sub DataGrid1_Click()
On Error GoTo ENDS:
If GRID2_CLICKED = True Then
INVOICE_NUMBER = rs_cur_invoice_item.Fields(6).Value
GRID2_CLICKED = False
Else
INVOICE_NUMBER = RS_PUR_ITEMS.Fields(0).Value
End If
Dim RS_SET_QTY_PRICE As New ADODB.Recordset
RS_SET_QTY_PRICE.Open "SELECT Qty,price_per_unit FROM AVAILABLE_PURCHASED_STOCK WHERE Invoice_no ='" & INVOICE_NUMBER & "' AND Item_type='" & Combo3.Text & "' AND Item_name='" & Combo2.Text & "' AND Party_name='" & Combo4.Text & "'", db, adOpenDynamic, adLockOptimistic
Text1(5).Text = RS_SET_QTY_PRICE.Fields(0).Value
Text1(6).Text = RS_SET_QTY_PRICE.Fields(1).Value
RS_SET_QTY_PRICE.Close
FILL_QTY (VAL(Text1(5).Text))
If Len(Text1(5).Text) > 0 Then
Text1(2).Enabled = True
Combo5.Enabled = True
End If
ENDS:
End Sub
Private Sub DataGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then
If cmd_op(0).Enabled = False Then
Dim x As Integer
x = MsgBox("Are you sure you want to Cancel updates ...", vbQuestion Or vbYesNo, "Want to cancel ?")
If x = 6 Then
Call cmd_op_Click(4)
End If
Exit Sub
End If
Dim y As Integer
y = MsgBox("Are you Sure you want to Cancel Sales Bill?", vbQuestion Or vbYesNo, "Want to Cancel Purchase Invoice ?")
If y = 6 Then
Unload Me
End If
ElseIf KeyCode = 116 Then
Call cmd_Click
End If
End Sub
Private Sub DataGrid2_Click()
INVOICE_NUMBER = rs_cur_invoice_item.Fields(6).Value
GRID2_CLICKED = True
Call FILLTEXT
Combo5.Enabled = False
Text1(2).Enabled = False
DataGrid1.Enabled = False
End Sub
Private Sub DataGrid2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then
If cmd_op(0).Enabled = False Then
Dim x As Integer
x = MsgBox("Are you sure you want to Cancel updates ...", vbQuestion Or vbYesNo, "Want to cancel ?")
If x = 6 Then
Call cmd_op_Click(4)
End If
Exit Sub
End If
Dim y As Integer
y = MsgBox("Are you Sure you want to Cancel Sales Bill?", vbQuestion Or vbYesNo, "Want to Cancel Purchase Invoice ?")
If y = 6 Then
Unload Me
End If
ElseIf KeyCode = 116 Then
Call cmd_Click
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then
If cmd_op(0).Enabled = False Then
Dim x As Integer
x = MsgBox("Are you sure you want to Cancel updates ...", vbQuestion Or vbYesNo, "Want to cancel ?")
If x = 6 Then
Call cmd_op_Click(4)
End If
Exit Sub
End If
Dim y As Integer
y = MsgBox("Are you Sure you want to Cancel Sales Bill?", vbQuestion Or vbYesNo, "Want to Cancel Purchase Invoice ?")
If y = 6 Then
Unload Me
End If
ElseIf KeyCode = 116 Then
Call cmd_Click
End If
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 23 Then
Text1(0).Text = "WithoutBill_" & Now
End If
End Sub
Private Sub Form_Load()
DTPicker1.Value = Date
SYSTEM_QTY = 0
SALE_TYPE = Clear
KeyPreview = True
Text1(0).Text = SALES_INVOICE_NUMBER()
SendKeys "{TAB}"
Dim DEL_RS As New ADODB.Recordset
DEL_RS.Open "SELECT * FROM SYS_CURRENT_SALES_ITEMS", db, adOpenDynamic, adLockOptimistic
While DEL_RS.EOF <> True
DEL_RS.Delete
DEL_RS.MoveNext
Wend
DEL_RS.Close
SNAME = Clear
LaVolpeButton2.Enabled = False
Me.Left = 0
Me.Top = 0
rs_custo_datail.Open "SELECT * FROM Customer_master", db, adOpenDynamic, adLockOptimistic
rs_cust_system_detail.Open "SELECT * FROM Customer_System_datail", db, adOpenDynamic, adLockOptimistic
rs_sales_master.Open "SELECT * FROM Sales_master", db, adOpenDynamic, adLockOptimistic
rs_cur_invoice_item.CursorLocation = adUseClient
rs_cur_invoice_item.Open "SELECT * FROM SYS_CURRENT_SALES_ITEMS", db, adOpenDynamic, adLockOptimistic
Set DataGrid2.DataSource = rs_cur_invoice_item
rs_cur_record_count.Open "SELECT COUNT(*) FROM SYS_CURRENT_SALES_ITEMS", db, adOpenDynamic, ad
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?