📄 storemaneger.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form storemanage
BackColor = &H00C0C0C0&
Caption = "库房管理"
ClientHeight = 8595
ClientLeft = 60
ClientTop = 345
ClientWidth = 11400
Icon = "storemaneger.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "storemaneger.frx":08CA
ScaleHeight = 8595
ScaleWidth = 11400
WindowState = 2 'Maximized
Begin VB.CommandButton Command5
Caption = "恢复原表与刷新"
Height = 495
Left = 9360
TabIndex = 15
Top = 1200
Width = 1695
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 1680
Top = 5760
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = $"storemaneger.frx":F946
OLEDBString = $"storemaneger.frx":FA04
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "Storeinfo"
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 VB.Frame Frame1
BackColor = &H00E0E0E0&
Caption = "库房信息添加"
Height = 5055
Left = 120
TabIndex = 2
Top = 360
Width = 5535
Begin VB.CommandButton Command9
Caption = "末记录"
Height = 375
Left = 3120
TabIndex = 19
Top = 3960
Width = 735
End
Begin VB.CommandButton Command8
Caption = "下一条"
Height = 375
Left = 2400
TabIndex = 18
Top = 3960
Width = 735
End
Begin VB.CommandButton Command7
Caption = "上一条"
Height = 375
Left = 1680
TabIndex = 17
Top = 3960
Width = 735
End
Begin VB.CommandButton Command6
Caption = "首记录"
Height = 375
Left = 960
TabIndex = 16
Top = 3960
Width = 735
End
Begin VB.CommandButton Command4
Caption = "取消"
Height = 375
Left = 3480
TabIndex = 14
Top = 3240
Width = 615
End
Begin VB.CommandButton Command3
Caption = "修改"
Height = 375
Left = 2400
TabIndex = 13
Top = 3240
Width = 615
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 375
Left = 1440
TabIndex = 12
Top = 3240
Width = 615
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 360
TabIndex = 11
Top = 3240
Width = 735
End
Begin VB.TextBox Text4
DataField = "保质期"
DataSource = "Data1"
Enabled = 0 'False
Height = 375
Left = 2400
TabIndex = 10
Top = 2280
Width = 1455
End
Begin VB.TextBox Text3
DataField = "库存量"
DataSource = "Data1"
Enabled = 0 'False
Height = 375
Left = 2400
TabIndex = 8
Top = 1560
Width = 1455
End
Begin VB.TextBox Text2
DataField = "品名"
DataSource = "Data1"
Enabled = 0 'False
Height = 375
Left = 2400
TabIndex = 6
Top = 960
Width = 1455
End
Begin VB.TextBox Text1
DataField = "商品标号"
DataSource = "Data1"
Enabled = 0 'False
Height = 375
Left = 2400
TabIndex = 4
Top = 360
Width = 1455
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "保质期/年-月-日"
Height = 375
Left = 600
TabIndex = 9
Top = 2280
Width = 1455
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "库存量"
Height = 375
Left = 840
TabIndex = 7
Top = 1560
Width = 1095
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "品名"
Height = 375
Left = 840
TabIndex = 5
Top = 960
Width = 1095
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "商品标号"
Height = 375
Left = 840
TabIndex = 3
Top = 360
Width = 1095
End
End
Begin VB.CommandButton Command10
Caption = "最近须采购的物品 "
Height = 495
Left = 6840
TabIndex = 1
Top = 1200
Width = 1815
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Bindings = "storemaneger.frx":FAC2
Height = 3135
Left = 6120
TabIndex = 0
Top = 2280
Width = 5655
_ExtentX = 9975
_ExtentY = 5530
_Version = 393216
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\Administrator\桌面\11050302超市管理系统(033069,033068, 033067)\源代码\supermarket1.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 6600
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Storeinfo"
Top = 480
Visible = 0 'False
Width = 2415
End
End
Attribute VB_Name = "storemanage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Trim(Text1.Text) = "" Then
MsgBox "商品标号不能为空!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "品名不能为空!", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Exit Sub
End If
If Trim(Text3.Text) = "" Then
MsgBox "库存量不能为空!", vbOKOnly + vbExclamation, ""
Text3.SetFocus
Exit Sub
End If
If Trim(Text4.Text) = "" Then
MsgBox "保质期不能为空!", vbOKOnly + vbExclamation, ""
Text4.SetFocus
Exit Sub
End If
Command2.Enabled = Not Command2.Enabled
Command3.Enabled = Not Command3.Enabled
Command4.Enabled = True
Command6.Enabled = Not Command6.Enabled
Command7.Enabled = Not Command7.Enabled
Command8.Enabled = Not Command8.Enabled
Command9.Enabled = Not Command9.Enabled
If Command1.Caption = "添加" Then
Command1.Caption = "确认"
Data1.Recordset.AddNew
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text1.SetFocus
Else
Command1.Caption = "添加"
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
If Trim(Text1.Text) = "" Then
Text1.Text = "1256701"
Data1.Recordset.Update
Data1.Recordset.MoveLast
Data1.Recordset.Delete
Data1.Recordset.MoveFirst
Else
Data1.Recordset.Update
Data1.Recordset.MoveLast
End If
End If
End Sub
Private Sub Command10_Click()
Data1.RecordSource = "select * from storeinfo where val(库存量)<=300"
Data1.Refresh
End Sub
Private Sub Command2_Click()
'On Error Resume Next
Data1.Recordset.Delete
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
Data1.Refresh
End If
Data1.RecordSource = "select * from storeinfo"
Data1.Refresh
End Sub
Private Sub Command3_Click()
On Error Resume Next
If Trim(Text1.Text) = "" Then
MsgBox "商品标号不能为空!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "品名不能为空!", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Exit Sub
End If
If Trim(Text3.Text) = "" Then
MsgBox "库存量不能为空!", vbOKOnly + vbExclamation, ""
Text3.SetFocus
Exit Sub
End If
If Trim(Text4.Text) = "" Then
MsgBox "保质期不能为空!", vbOKOnly + vbExclamation, ""
Text4.SetFocus
Exit Sub
End If
Command1.Enabled = Not Command1.Enabled
Command2.Enabled = Not Command2.Enabled
Command4.Enabled = True
Command6.Enabled = Not Command6.Enabled
Command7.Enabled = Not Command7.Enabled
Command8.Enabled = Not Command8.Enabled
Command9.Enabled = Not Command9.Enabled
If Command3.Caption = "修改" Then
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Command3.Caption = "确认"
Data1.Recordset.Edit
Text1.SetFocus
Else
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Command3.Caption = "修改"
Data1.Recordset.Update
End If
End Sub
Private Sub Command4_Click()
Command1.Caption = "添加"
Command3.Caption = "修改"
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = False
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Data1.UpdateControls
Data1.Recordset.MoveNext
Data1.Refresh
End Sub
Private Sub Command5_Click()
Data1.RecordSource = "storeinfo"
Data1.Refresh
End Sub
Private Sub Command6_Click()
Data1.Recordset.MoveFirst
End Sub
Private Sub Command7_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
End If
End Sub
Private Sub Command8_Click()
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End Sub
Private Sub Command9_Click()
Data1.Recordset.MoveLast
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -