📄 form1.frm
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form Form1
Caption = "订单管理系统"
ClientHeight = 8310
ClientLeft = 165
ClientTop = 735
ClientWidth = 11880
LinkTopic = "Form1"
ScaleHeight = 8310
ScaleWidth = 11880
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command7
Caption = "刷 新"
Height = 495
Left = 8520
TabIndex = 9
Top = 240
Width = 975
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "Form1.frx":0000
Height = 5895
Left = 120
OleObjectBlob = "Form1.frx":0017
TabIndex = 8
Top = 1320
Width = 14535
End
Begin VB.Data Datamain
Caption = "Data1"
Connect = "Access"
DatabaseName = "F:\作业\作业\database2.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 600
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 7680
Visible = 0 'False
Width = 4335
End
Begin VB.CommandButton Command4
Caption = "查询订单"
Height = 495
Left = 6360
TabIndex = 6
Top = 240
Width = 975
End
Begin VB.TextBox Text1
Height = 285
Left = 1080
TabIndex = 4
Top = 360
Width = 1575
End
Begin VB.CommandButton Command5
Caption = "订单打印"
Height = 495
Index = 0
Left = 7440
TabIndex = 3
Top = 240
Width = 975
End
Begin VB.CommandButton Command1
Caption = "新建订单"
Height = 495
Index = 0
Left = 3120
TabIndex = 2
Top = 240
Width = 975
End
Begin VB.CommandButton Command3
Caption = "修改订单"
Height = 495
Index = 1
Left = 5280
TabIndex = 1
Top = 240
Width = 975
End
Begin VB.CommandButton Command2
Caption = "删除订单"
Height = 495
Index = 4
Left = 4200
TabIndex = 0
Top = 240
Width = 975
End
Begin VB.Label Label2
Caption = "订单数量"
Height = 255
Left = 120
TabIndex = 7
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "订单列表"
Height = 255
Left = 120
TabIndex = 5
Top = 960
Width = 735
End
Begin VB.Menu mFile
Caption = "文件"
Begin VB.Menu mFileNew
Caption = "新建"
End
Begin VB.Menu mFileOpen
Caption = "打开"
End
Begin VB.Menu mFileSave
Caption = "保存"
End
Begin VB.Menu mFileSaveAs
Caption = "另存为"
End
Begin VB.Menu mFile__
Caption = "-"
End
Begin VB.Menu mFilePrint
Caption = "打印"
End
Begin VB.Menu mFile_
Caption = "-"
End
Begin VB.Menu mFileExit
Caption = "退出"
End
End
Begin VB.Menu mEdit
Caption = "编辑"
Begin VB.Menu mEditUndo
Caption = "撤销"
End
Begin VB.Menu mEdit__
Caption = "-"
End
Begin VB.Menu mEditCopy
Caption = "复制"
End
Begin VB.Menu mEditCut
Caption = "剪切"
End
Begin VB.Menu mEditPaste
Caption = "粘贴"
End
Begin VB.Menu mEdit_
Caption = "-"
Index = 1
End
Begin VB.Menu mEditSelectAll
Caption = "全选"
End
End
Begin VB.Menu mView
Caption = "视图"
Begin VB.Menu mViewToolbar
Caption = "工具栏"
End
Begin VB.Menu mViewStatusbar
Caption = "状态栏"
End
Begin VB.Menu mView_
Caption = "-"
End
Begin VB.Menu mEditRefresh
Caption = "刷新"
End
Begin VB.Menu mEditOption
Caption = "选项"
End
End
Begin VB.Menu mOperate
Caption = "操作"
Begin VB.Menu mOperateNew
Caption = "新建订单"
End
Begin VB.Menu mOperateModify
Caption = "修改订单"
End
Begin VB.Menu mOperateDelete
Caption = "删除订单"
End
Begin VB.Menu mOperateActivate
Caption = "激活订单"
End
Begin VB.Menu mOperateCancel
Caption = "取消订单"
End
Begin VB.Menu usermanage
Caption = "用户管理"
End
End
Begin VB.Menu mWindow
Caption = "窗口"
Begin VB.Menu mWindowC
Caption = "层叠"
End
Begin VB.Menu mWindowH
Caption = "水平平铺"
End
Begin VB.Menu mWindowV
Caption = "垂直平铺"
End
Begin VB.Menu mWindowA
Caption = "排列图标"
End
End
Begin VB.Menu mHelp
Caption = "帮助"
Begin VB.Menu mHelpTopic
Caption = "主题"
End
Begin VB.Menu mHelpIndex
Caption = "索引"
End
Begin VB.Menu mHelp_
Caption = "-"
End
Begin VB.Menu mHelpAbout
Caption = "关于"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim user_power As Integer
Dim Areturn As Integer
Dim s, Y
Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error Resume Next
Select Case Button.Key
Case "Button"
'ToDo: Add 'Button' button code.
MsgBox "Add 'Button' button code."
End Select
End Sub
Private Sub Command1_Click(Index As Integer)
Form2.Show
End Sub
Private Sub Command2_Click(Index As Integer)
Dim a As String
If Datamain.Recordset.RecordCount > 0 Then
a = MsgBox("您确实要删除这条数据吗?", vbYesNo, "提示")
If a = vbYes Then
Datamain.Recordset.Delete
Datamain.Refresh
End If
Else
MsgBox "您没有要删除的数据!", , "提示"
End If
End Sub
Private Sub Command3_Click(Index As Integer)
DBGrid1.Col = 0
productname1 = DBGrid1.Text
DBGrid1.Col = 1
orderid1 = DBGrid1.Text
DBGrid1.Col = 2
producttype1 = DBGrid1.Text
DBGrid1.Col = 3
customername1 = DBGrid1.Text
DBGrid1.Col = 4
operatorname1 = DBGrid1.Text
DBGrid1.Col = 5
destination1 = DBGrid1.Text
DBGrid1.Col = 6
orderdate1 = DBGrid1.Text
DBGrid1.Col = 7
finishdate1 = DBGrid1.Text
DBGrid1.Col = 8
price1 = DBGrid1.Text
DBGrid1.Col = 9
number1 = DBGrid1.Text
DBGrid1.Col = 10
total1 = DBGrid1.Text
DBGrid1.Col = 11
transport1 = DBGrid1.Text
DBGrid1.Col = 12
pay1 = DBGrid1.Text
DBGrid1.Col = 13
status1 = DBGrid1.Text
Form5.Show
End Sub
Private Sub Command4_Click()
Form3.Show
End Sub
Private Sub Command7_Click()
Datamain.Refresh
End Sub
Private Sub Form_Load()
Dim table_name As String
Dim sql As String
If user_power < 50 Then
Command1(0).Enabled = False
Command2(4).Enabled = False
Command3(1).Enabled = False
Command5(0).Enabled = False
End If
table_name = "sub"
sql = "SELECT * FROM sub order by orderid" '& table_name
Datamain.Caption = table_name
Datamain.RecordSource = sql
Datamain.Refresh
End Sub
Private Sub mfileexit_Click()
Areturn = MsgBox("确实要退出订单管理系统吗?", vbOKCancel + vbDefaultButton1 + vbQuestion, "订单管理系统")
If Areturn = vbOK Then
End
End If
End Sub
Private Sub mHelpAbout_Click()
MsgBox "订单管理系统 1.0版本", , "关于"
End Sub
Private Sub mOperateNew_Click()
Form2.Show
End Sub
Private Sub usermanage_Click()
user.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -