📄 frmpmoi.frm
字号:
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = "sa"
Password = ""
RecordSource = "select * from POCt"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSComCtl2.DTPicker DTPicker1
DataSource = "Adodc1"
Height = 375
Left = 1920
TabIndex = 30
Top = 300
Width = 1695
_ExtentX = 2990
_ExtentY = 661
_Version = 393216
Enabled = 0 'False
Format = 60620801
CurrentDate = 37768
End
Begin VB.TextBox Text1
Height = 300
Index = 2
Left = 5900
TabIndex = 4
Top = 360
Width = 1700
End
Begin VB.TextBox Text1
Height = 300
Index = 0
Left = 1900
TabIndex = 3
Top = 800
Width = 1700
End
Begin VB.TextBox Text1
Height = 300
Index = 1
Left = 5880
TabIndex = 2
Top = 800
Width = 1700
End
Begin VB.ComboBox Combo2
Height = 300
Left = 1920
TabIndex = 1
Top = 1320
Width = 1695
End
Begin VB.Label Label1
Caption = "OutputDate:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 0
Left = 240
TabIndex = 9
Top = 360
Width = 1335
End
Begin VB.Label Label1
Caption = "Invoicemaker:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 12
Left = 4200
TabIndex = 8
Top = 360
Width = 1700
End
Begin VB.Label Label1
Caption = "ApprovedBy:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 11
Left = 4200
TabIndex = 7
Top = 800
Width = 1695
End
Begin VB.Label Label1
Caption = "InvoiceExamer:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 13
Left = 240
TabIndex = 6
Top = 840
Width = 1695
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Warehouse:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 240
TabIndex = 5
Top = 1320
Width = 1200
End
End
Begin MSComctlLib.Toolbar Toolbar1
Height = 780
Left = 5760
TabIndex = 27
Top = 7080
Width = 2115
_ExtentX = 3731
_ExtentY = 1376
ButtonWidth = 1032
ButtonHeight = 1376
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 3
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Save"
Key = "Save"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Cancel"
Key = "Cancel"
ImageIndex = 2
EndProperty
EndProperty
Begin MSComctlLib.ImageList ImageList1
Left = 1560
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmpmoi.frx":0D0F
Key = "Save"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmpmoi.frx":1029
Key = "Cancel"
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "frmpmoi"
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(frmpoutput.Adodc_pod.Recordset.Fields(8)) 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(frmpoutput.Adodc_pod.Recordset.Fields(8)) & "" & _
"Where ProductID ='" & Trim(Adodc_pmoi.Recordset.Fields(5)) & "'"
db.Close
End If
If Trim(Text1(8).Text) <> Trim(frmpoutput.Adodc_pod.Recordset.Fields(10)) 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(frmpoutput.Adodc_pod.Recordset.Fields(10)) & "" & _
"Where ProductID ='" & Trim(Adodc_pmoi.Recordset.Fields(5)) & "'"
db.Close
End If
frmpoutput.Adodc_poc.Recordset.Delete
frmpoutput.Adodc_pod.Recordset.Delete
frmpoutput.Adodc_poc.Refresh
frmpoutput.Adodc_pod.Refresh
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "insert into POC select * from POCt where OutputID=" & _
"'" & 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 POD select OutputID,OutputDate,Warehouse,OutputType,Client," & _
"ProductID,ProductName,Unit,Quantity,UnitPrice,Total,Remarks from PODt " & _
"where OutputID='" & 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 PODt set Isexamed='1' where OutputID=" & _
"'" & 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 poct"
db.Close
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
db.Execute "delete from podt"
db.Close
frmpoutput.Adodc_poc.Refresh
frmpoutput.Adodc_pod.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 POCt values('" & Trim(frmpoutput.Adodc_poc.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 PODt values('" & Trim(frmpoutput.Adodc_pod.Recordset.Fields(0)) & "'," & _
"'" & Trim(DTPicker1.Value) & "','" & Trim(Combo2.Text) & "'," & _
"'" & Trim(Combo1(2).Text) & "','" & Trim(Text1(3).Text) & "'," & _
"'" & Trim(Text1(9).Text) & "','" & Trim(Text1(7).Text) & "'," & _
"'" & Trim(Text1(4).Text) & "','" & Trim(Text1(8).Text) & "'," & _
"'" & Trim(Text1(6).Text) & "','" & Trim(Text1(5).Text) & "','1'," & _
"'" & Trim(Text2.Text) & "')"
db.Close
Adodc_pmoi.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)
Combo2.Text = Adodc_pmoi.Recordset.Fields(2)
Combo1(2).Text = Adodc_pmoi.Recordset.Fields(3)
Text1(3).Text = Adodc_pmoi.Recordset.Fields(4)
Text1(9).Text = Adodc_pmoi.Recordset.Fields(5)
Text1(7).Text = Adodc_pmoi.Recordset.Fields(6)
Text1(4).Text = Adodc_pmoi.Recordset.Fields(7)
Text1(8).Text = Adodc_pmoi.Recordset.Fields(8)
Text1(6).Text = Adodc_pmoi.Recordset.Fields(9)
Text1(5).Text = Adodc_pmoi.Recordset.Fields(10)
Text2.Text = Adodc_pmoi.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 POCt"
db.Execute "delete from PODt"
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 poct where OutputId='" & 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 podt where OutputId='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
db.Close
Adodc_pmoi.Refresh
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -