📄 pinput.frm
字号:
AllowUpdate = 0 'False
AllowArrows = -1 'True
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 6
BeginProperty Column00
DataField = "InputID"
Caption = "InputID"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "InputDate"
Caption = "InputDate"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "Warehouse"
Caption = "Warehouse"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
DataField = "InvoiceMaker"
Caption = "InvoiceMaker"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
DataField = "InvoiceExaminer"
Caption = "InvoiceExaminer"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column05
DataField = "ApprovedBy"
Caption = "ApprovedBy"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 2085.166
EndProperty
BeginProperty Column01
ColumnWidth = 2085.166
EndProperty
BeginProperty Column02
ColumnWidth = 2085.166
EndProperty
BeginProperty Column03
ColumnWidth = 2085.166
EndProperty
BeginProperty Column04
ColumnWidth = 2085.166
EndProperty
BeginProperty Column05
ColumnWidth = 2085.166
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList ImageList1
Left = 4320
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "pinput.frx":0030
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "pinput.frx":0484
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "pinput.frx":08D8
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "pinput.frx":0D2C
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "pinput.frx":1180
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 780
Left = 0
TabIndex = 3
Top = 0
Width = 11880
_ExtentX = 20955
_ExtentY = 1376
ButtonWidth = 1032
ButtonHeight = 1376
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 9
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "add"
Key = "add"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "modify"
Key = "modify"
ImageIndex = 2
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "delete"
Key = "delete"
ImageIndex = 3
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "find"
Key = "find"
ImageIndex = 4
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "quit"
Key = "quit"
ImageIndex = 5
EndProperty
EndProperty
End
Begin VB.Label Label3
Caption = " Detail:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 300
TabIndex = 4
Top = 4740
Width = 1515
End
Begin VB.Label Label2
Caption = " Common:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 2
Top = 840
Width = 1515
End
Begin VB.Label Label1
Caption = "Product Input"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3360
TabIndex = 1
Top = 780
Width = 3375
End
End
Attribute VB_Name = "frmpinput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub DataGrid2_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
On Error GoTo err_handler
DataGrid1.Bookmark = DataGrid2.Bookmark
DataGrid1.Refresh
err_handler:
If err.Number = 6149 Then
MsgBox "This is a bug on bookmark!", vbOKOnly, "Error"
End If
End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
On Error GoTo err_handler
DataGrid2.Bookmark = DataGrid1.Bookmark
DataGrid2.Refresh
err_handler:
If err.Number = 6149 Then
MsgBox "This is a bug on bookmark!", vbOKOnly, "Error"
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "add"
frmpaii.Show 1
Case "modify"
If Adodc_pic.Recordset.BOF = True Or Adodc_pid.Recordset.BOF = True Then
MsgBox "No data to modify now!", vbOKOnly, "Error"
Else
Set db = New ADODB.Connection
With db
.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
.Execute "delete from pidt"
.Close
End With
With db
.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
.Execute "insert into pidt values('" & Trim(Adodc_pid.Recordset.Fields(0)) & "'," & _
"'" & Trim(Adodc_pid.Recordset.Fields(1)) & "','" & Trim(Adodc_pid.Recordset.Fields(2)) & "'," & _
"'" & Trim(Adodc_pid.Recordset.Fields(3)) & "','" & Trim(Adodc_pid.Recordset.Fields(4)) & "'," & _
"'" & Trim(Adodc_pid.Recordset.Fields(5)) & "','" & Trim(Adodc_pid.Recordset.Fields(6)) & "'," & _
"'" & Trim(Adodc_pid.Recordset.Fields(7)) & "','" & Trim(Adodc_pid.Recordset.Fields(8)) & "'," & _
"'" & Trim(Adodc_pid.Recordset.Fields(9)) & "','" & Trim(Adodc_pid.Recordset.Fields(10)) & "'," & _
"'0','" & Trim(Adodc_pid.Recordset.Fields(11)) & "')"
.Close
End With
With db
.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
.Execute "insert into pict values('" & Trim(Adodc_pic.Recordset.Fields(0)) & "','" & Trim(Adodc_pic.Recordset.Fields(1)) & "','" & Trim(Adodc_pic.Recordset.Fields(2)) & "','" & Trim(Adodc_pic.Recordset.Fields(3)) & "','" & Trim(Adodc_pic.Recordset.Fields(4)) & "','" & Trim(Adodc_pic.Recordset.Fields(5)) & "')"
.Close
End With
frmpmii.Adodc1.Refresh
frmpmii.Adodc_pmii.Refresh
frmpmii.Show 1
End If
Case "delete"
If Adodc_pic.Recordset.BOF = True Or Adodc_pid.Recordset.BOF = True Then
MsgBox "No data to del now!", vbOKOnly, "Error"
Else
Set db = New ADODB.Connection
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(Adodc_pid.Recordset.Fields(9)) & ",Quantity=Quantity-" & Trim(Adodc_pid.Recordset.Fields(7)) & "where ProductID=" & _
"'" & Trim(Adodc_pid.Recordset.Fields(5)) & "'"
db.Close
Adodc_pic.Recordset.Delete
Adodc_pid.Recordset.Delete
Adodc_pic.Refresh
Adodc_pid.Refresh
End If
Case "find"
Findpi.Show 1
Case "quit"
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -