📄 spgld.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "Msadodc.OCX"
Begin VB.Form spgld
BorderStyle = 3 'Fixed Dialog
Caption = "商品管理"
ClientHeight = 6825
ClientLeft = 45
ClientTop = 330
ClientWidth = 8070
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "spgld.frx":0000
ScaleHeight = 6825
ScaleWidth = 8070
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin MSDataGridLib.DataGrid msglist
Bindings = "spgld.frx":22B35
Height = 1935
Left = 120
TabIndex = 15
Top = 4560
Width = 7695
_ExtentX = 13573
_ExtentY = 3413
_Version = 393216
BackColor = 16744576
HeadLines = 1
RowHeight = 15
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 = 2
BeginProperty Column00
DataField = ""
Caption = ""
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 = ""
Caption = ""
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
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 615
Left = 0
TabIndex = 14
Top = 0
Width = 8070
_ExtentX = 14235
_ExtentY = 1085
ButtonWidth = 1773
ButtonHeight = 926
Appearance = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 4
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 添 加 "
Key = "TJ"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删 除"
Key = "SC"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保 存"
Key = "BC"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 取 消 "
Key = "QX"
EndProperty
EndProperty
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 8640
Top = 240
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Password=515515;Persist Security Info=True;User ID=sa;Data Source=login"
OLEDBString = "Provider=MSDASQL.1;Password=515515;Persist Security Info=True;User ID=sa;Data Source=login"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from goods"
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
End
Begin VB.Frame Frame1
BackColor = &H00FF8080&
Caption = "商品管理信息"
Height = 3495
Left = 120
TabIndex = 3
Top = 960
Width = 7695
Begin VB.ComboBox Combo1
DataField = "供应商"
DataSource = "Adodc1"
Height = 300
Left = 4680
TabIndex = 18
Text = "Combo1"
Top = 1800
Width = 2175
End
Begin VB.TextBox Text1
DataField = "编号"
DataSource = "Adodc1"
Height = 375
Left = 3360
TabIndex = 17
Text = "Text1"
Top = 240
Width = 1575
End
Begin VB.TextBox txtItem
DataField = "备注"
DataSource = "Adodc1"
Height = 1080
Index = 11
Left = 1320
MaxLength = 80
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 13
Top = 2280
Width = 4692
End
Begin VB.TextBox txtItem
DataField = "成本单价"
DataSource = "Adodc1"
Height = 270
Index = 6
Left = 4680
MaxLength = 10
TabIndex = 12
Top = 1320
Width = 2175
End
Begin VB.TextBox txtItem
DataField = "单位"
DataSource = "Adodc1"
Height = 270
Index = 5
Left = 4680
MaxLength = 10
TabIndex = 11
Top = 840
Width = 2175
End
Begin VB.TextBox txtItem
DataField = "商品名称"
DataSource = "Adodc1"
Height = 270
Index = 0
Left = 1320
MaxLength = 8
TabIndex = 0
Top = 840
Width = 2175
End
Begin VB.TextBox txtItem
DataField = "库存数量"
DataSource = "Adodc1"
Height = 270
Index = 1
Left = 1320
MaxLength = 20
TabIndex = 1
Top = 1320
Width = 2175
End
Begin VB.TextBox txtItem
DataField = "销售单价"
DataSource = "Adodc1"
Height = 270
Index = 2
Left = 1320
MaxLength = 20
TabIndex = 2
Top = 1800
Width = 2175
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "商品编号:"
Height = 255
Left = 2280
TabIndex = 16
Top = 360
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "备 注:"
Height = 255
Index = 6
Left = 240
TabIndex = 10
Top = 2520
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "成 本 价:"
Height = 255
Index = 5
Left = 3720
TabIndex = 9
Top = 1320
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "商品单位:"
Height = 255
Index = 4
Left = 3720
TabIndex = 8
Top = 840
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "商品名称:"
Height = 255
Index = 0
Left = 240
TabIndex = 7
Top = 840
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "商品数量:"
Height = 255
Index = 1
Left = 240
TabIndex = 6
Top = 1320
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "供 应 商:"
Height = 255
Index = 2
Left = 3720
TabIndex = 5
Top = 1800
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "销 售 价:"
Height = 255
Index = 16
Left = 240
TabIndex = 4
Top = 1800
Width = 975
End
End
End
Attribute VB_Name = "spgld"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub txtItems_lostfocus()
If Not IsNumeric(txtItem(1).Text) Then
MsgBox "请输入数字!!", vbExclamation + vbOKOnly, 提示
txtItem(1).SetFocus
End If
End Sub
Private Sub Form_Load()
Dim txtsql As String
Dim msgtext As String
Dim mrc As ADODB.Recordset
txtsql = "select distinct 供应商名称 from proviter"
Set mrc = ExecuteSQL(txtsql, msgtext)
If mrc.EOF = False Then
Do While Not mrc.EOF
Combo1.AddItem Trim(mrc.Fields(0))
mrc.MoveNext
Loop
Combo1.ListIndex = 0
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
On Error Resume Next
Adodc1.Recordset.AddNew
Adodc1.Recordset("编号") = ""
Adodc1.Recordset("供应商") = ""
Adodc1.Recordset("商品名称") = ""
Adodc1.Recordset("成本单价") = ""
Adodc1.Recordset("销售单价") = ""
Adodc1.Recordset("备注") = ""
Adodc1.Recordset("单位") = ""
Adodc1.Recordset("库存数量") = ""
Adodc1.Recordset.MoveLast
Case 2
If Not (Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF) Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
End If
Case 3
Adodc1.Recordset.Update
msglist.Refresh
Case 4
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -