📄 addinputinvoice.frm
字号:
Left = 1900
TabIndex = 19
Top = 750
Width = 1700
End
Begin VB.TextBox Text1
Height = 300
Index = 8
Left = 1900
TabIndex = 18
Top = 1150
Width = 1700
End
Begin VB.TextBox Text1
Height = 300
Index = 7
Left = 5900
TabIndex = 17
Top = 350
Width = 1700
End
Begin VB.TextBox Text1
Height = 300
Index = 6
Left = 5900
TabIndex = 16
Top = 750
Width = 1700
End
Begin VB.TextBox Text1
Height = 300
Index = 5
Left = 5880
TabIndex = 15
Top = 1200
Width = 1700
End
Begin VB.TextBox Text1
Height = 300
Index = 3
Left = 5880
TabIndex = 14
Top = 1560
Width = 1700
End
Begin VB.Label Label1
Caption = "InputType:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 22
Left = 200
TabIndex = 13
Top = 350
Width = 1700
End
Begin VB.Label Label1
Caption = "ProductID:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 21
Left = 200
TabIndex = 12
Top = 750
Width = 1700
End
Begin VB.Label Label1
Caption = "Quantity:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 20
Left = 200
TabIndex = 11
Top = 1150
Width = 1700
End
Begin VB.Label Label1
Caption = "Dept:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 19
Left = 200
TabIndex = 10
Top = 1550
Width = 1700
End
Begin VB.Label Label1
Caption = "Remarks:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 18
Left = 200
TabIndex = 9
Top = 1950
Width = 1700
End
Begin VB.Label Label1
Caption = "ProductName:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 17
Left = 4200
TabIndex = 8
Top = 350
Width = 1700
End
Begin VB.Label Label1
Caption = "UnitPrice:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 16
Left = 4200
TabIndex = 7
Top = 750
Width = 1700
End
Begin VB.Label Label1
Caption = "Total:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 15
Left = 4200
TabIndex = 6
Top = 1150
Width = 1700
End
Begin VB.Label Label1
Caption = "Status:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 10
Left = 4200
TabIndex = 5
Top = 1560
Width = 1695
End
End
End
Attribute VB_Name = "frmpmii"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Set db = New ADODB.Connection
Select Case Button.Key
Case "Save"
If Trim(Text1(5).Text) <> Trim(frmpinput.Adodc_pid.Recordset.Fields(9)) Then
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "update PI set Total = Total+" & Trim(Text1(5).Text) & "" & _
"-" & Trim(frmpinput.Adodc_pid.Recordset.Fields(9)) & "" & _
"Where ProductID ='" & Trim(Adodc_pmii.Recordset.Fields(5)) & "'"
db.Close
End If
If Trim(Text1(8).Text) <> Trim(frmpinput.Adodc_pid.Recordset.Fields(7)) Then
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "update PI set Quantity = Quantity+" & Trim(Text1(8).Text) & "" & _
"-" & Trim(frmpinput.Adodc_pid.Recordset.Fields(7)) & "" & _
"Where ProductID ='" & Trim(Adodc_pmii.Recordset.Fields(5)) & "'"
db.Close
End If
frmpinput.Adodc_pic.Recordset.Delete
frmpinput.Adodc_pid.Recordset.Delete
frmpinput.Adodc_pic.Refresh
frmpinput.Adodc_pid.Refresh
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "insert into PIC select * from PICt where InputID=" & _
"'" & Trim(Adodc1.Recordset.Fields(0)) & "'"
db.Close
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "insert into PID select InputID,InputDate,InputType,Warehouse,Department," & _
"ProductID,ProductName,Quantity,UnitPrice,Total,Status,Remarks from PIDt " & _
"where InputID='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
db.Close
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "update PIDt set Isexamed='1' where InputID=" & _
"'" & Trim(Adodc1.Recordset.Fields(0)) & "'"
db.Close
Case "Cancel"
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "delete from pict"
db.Close
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "delete from pidt"
db.Close
frmpinput.Adodc_pic.Refresh
frmpinput.Adodc_pid.Refresh
Unload Me
End Select
End Sub
Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)
Set db = New ADODB.Connection
Select Case Button.Key
Case "In"
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "insert into PICt values('" & Trim(frmpinput.Adodc_pic.Recordset.Fields(0)) & "'," & _
"'" & Trim(DTPicker1.Value) & "','" & Trim(Combo2.Text) & "'," & _
"'" & Trim(Text1(2).Text) & "','" & Trim(Text1(0).Text) & "'," & _
"'" & Trim(Text1(1).Text) & "')"
db.Close
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "insert into PIDt values('" & Trim(frmpinput.Adodc_pid.Recordset.Fields(0)) & "'," & _
"'" & Trim(DTPicker1.Value) & "','" & Trim(Combo1(2).Text) & "'," & _
"'" & Trim(Combo2.Text) & "','" & Trim(Combo1(1)) & "'," & _
"'" & Trim(Text1(9).Text) & "','" & Trim(Text1(7).Text) & "'," & _
"'" & Trim(Text1(8).Text) & "','" & Trim(Text1(6).Text) & "'," & _
"'" & Trim(Text1(5).Text) & "','" & Trim(Text1(3).Text) & "','1'," & _
"'" & Trim(Text2.Text) & "')"
db.Close
Adodc_pmii.Refresh
Case "Out"
DTPicker1.Value = Adodc1.Recordset.Fields(1)
Combo2.Text = Adodc1.Recordset.Fields(2)
Text1(2).Text = Adodc1.Recordset.Fields(3)
Text1(0).Text = Adodc1.Recordset.Fields(4)
Text1(1).Text = Adodc1.Recordset.Fields(5)
Combo1(2).Text = Adodc_pmii.Recordset.Fields(2)
Combo1(1).Text = Adodc_pmii.Recordset.Fields(4)
Text1(3).Text = Adodc_pmii.Recordset.Fields(10)
Text1(5).Text = Adodc_pmii.Recordset.Fields(9)
Text1(6).Text = Adodc_pmii.Recordset.Fields(8)
Text1(7).Text = Adodc_pmii.Recordset.Fields(6)
Text1(8).Text = Adodc_pmii.Recordset.Fields(7)
Text1(9).Text = Adodc_pmii.Recordset.Fields(5)
Text2.Text = Adodc_pmii.Recordset.Fields(12)
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "delete from PICt"
db.Execute "delete from PIDt"
db.Close
Case "Cancel"
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "delete from pict where InputId='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
db.Close
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "delete from pidt where InputId='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
db.Close
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -