⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 order.frm

📁 本人下载的另一个VISUAL BACIC的定单管理系统~很有特点
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   Caption         =   "新建订单"
   ClientHeight    =   7860
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   10680
   LinkTopic       =   "Form1"
   ScaleHeight     =   7860
   ScaleWidth      =   10680
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox status 
      Height          =   270
      Left            =   1080
      TabIndex        =   32
      Top             =   4440
      Width           =   2055
   End
   Begin VB.TextBox pay 
      Height          =   270
      Left            =   1080
      TabIndex        =   31
      Top             =   3240
      Width           =   2055
   End
   Begin VB.TextBox transport 
      Height          =   270
      Left            =   1080
      TabIndex        =   30
      Top             =   2640
      Width           =   2055
   End
   Begin VB.TextBox destination 
      Height          =   270
      Left            =   3840
      TabIndex        =   29
      Top             =   1440
      Width           =   1935
   End
   Begin VB.TextBox customername 
      Height          =   270
      Left            =   3840
      TabIndex        =   28
      Top             =   840
      Width           =   1935
   End
   Begin VB.Data data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "F:\作业\作业\database2.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   495
      Left            =   1200
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   5640
      Visible         =   0   'False
      Width           =   3855
   End
   Begin VB.TextBox Text12 
      Height          =   735
      Left            =   -120
      TabIndex        =   26
      Top             =   6240
      Width           =   10575
   End
   Begin VB.TextBox finishdate 
      Height          =   270
      Left            =   4680
      TabIndex        =   21
      Top             =   3840
      Width           =   1935
   End
   Begin VB.TextBox orderdate 
      Height          =   270
      Left            =   1080
      TabIndex        =   19
      Top             =   3840
      Width           =   2055
   End
   Begin VB.TextBox total 
      Height          =   270
      Left            =   6840
      TabIndex        =   17
      Top             =   2040
      Width           =   1455
   End
   Begin VB.TextBox number 
      Height          =   270
      Left            =   3840
      TabIndex        =   15
      Top             =   2040
      Width           =   1935
   End
   Begin VB.TextBox price 
      Height          =   270
      Left            =   1080
      TabIndex        =   13
      Top             =   2040
      Width           =   1335
   End
   Begin VB.TextBox operatorname 
      Height          =   270
      Left            =   1080
      TabIndex        =   10
      Top             =   1440
      Width           =   1335
   End
   Begin VB.CommandButton Command3 
      Caption         =   "退出"
      Height          =   735
      Left            =   9240
      TabIndex        =   8
      Top             =   240
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "打印订单"
      Height          =   735
      Left            =   8040
      TabIndex        =   7
      Top             =   240
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "生成订单"
      Height          =   735
      Left            =   6840
      TabIndex        =   6
      Top             =   240
      Width           =   1095
   End
   Begin VB.TextBox producttype 
      Height          =   270
      Left            =   1080
      TabIndex        =   5
      Top             =   840
      Width           =   1335
   End
   Begin VB.TextBox productname 
      DataSource      =   "data1"
      Height          =   270
      Left            =   3840
      TabIndex        =   3
      Top             =   240
      Width           =   1935
   End
   Begin VB.TextBox orderid 
      DataSource      =   "ordername"
      Height          =   270
      Left            =   1080
      TabIndex        =   1
      Top             =   240
      Width           =   1335
   End
   Begin VB.Label Label5 
      BackColor       =   &H80000018&
      Caption         =   "(请在""未处理"",""已出货"",""已付款"",""已完成""中选择)"
      ForeColor       =   &H8000000D&
      Height          =   255
      Left            =   3360
      TabIndex        =   33
      Top             =   4440
      Width           =   4335
   End
   Begin VB.Line Line1 
      X1              =   0
      X2              =   11880
      Y1              =   5040
      Y2              =   5040
   End
   Begin VB.Label Label18 
      Caption         =   "客户名称"
      Height          =   255
      Left            =   2880
      TabIndex        =   27
      Top             =   840
      Width           =   855
   End
   Begin VB.Label Label17 
      Caption         =   "备注"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   25
      Top             =   5400
      Width           =   1215
   End
   Begin VB.Label Label16 
      Caption         =   "订单状态"
      Height          =   375
      Left            =   120
      TabIndex        =   24
      Top             =   4440
      Width           =   1215
   End
   Begin VB.Label Label15 
      Caption         =   "付款方式"
      Height          =   255
      Left            =   120
      TabIndex        =   23
      Top             =   3240
      Width           =   975
   End
   Begin VB.Label Label14 
      Caption         =   "运输方式"
      Height          =   255
      Left            =   120
      TabIndex        =   22
      Top             =   2640
      Width           =   1335
   End
   Begin VB.Label Label13 
      Caption         =   "交货日期"
      Height          =   255
      Left            =   3480
      TabIndex        =   20
      Top             =   3840
      Width           =   1215
   End
   Begin VB.Label Label12 
      Caption         =   "订单日期"
      Height          =   255
      Left            =   120
      TabIndex        =   18
      Top             =   3840
      Width           =   855
   End
   Begin VB.Label Label11 
      Caption         =   "总额"
      Height          =   255
      Left            =   6120
      TabIndex        =   16
      Top             =   2040
      Width           =   855
   End
   Begin VB.Label Label10 
      Caption         =   "数量"
      Height          =   255
      Left            =   2880
      TabIndex        =   14
      Top             =   2040
      Width           =   855
   End
   Begin VB.Label Label9 
      Caption         =   "单价"
      Height          =   255
      Left            =   120
      TabIndex        =   12
      Top             =   2040
      Width           =   975
   End
   Begin VB.Label Label8 
      Caption         =   "目的地"
      Height          =   255
      Left            =   2880
      TabIndex        =   11
      Top             =   1440
      Width           =   1095
   End
   Begin VB.Label Label4 
      Caption         =   "业务员"
      Height          =   255
      Left            =   120
      TabIndex        =   9
      Top             =   1440
      Width           =   855
   End
   Begin VB.Label Label3 
      Caption         =   "产品型号"
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   840
      Width           =   735
   End
   Begin VB.Label Label2 
      Caption         =   "产品名称"
      Height          =   255
      Left            =   2880
      TabIndex        =   2
      Top             =   240
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "订单编号"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   975
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Dim db As Database
Dim rs As Recordset

Private Sub Command1_Click()

Dim user_id As Integer
Dim RecCount As Integer
user_id = orderid.Text
data1.RecordSource = "select * from sub where OrderID = " & user_id & ""
data1.Refresh

RecCount = data1.Recordset.RecordCount
'RecCount = 1
If RecCount > 0 Then
MsgBox "已经存在此编号的订单,请重新输入!", , "提示"
Exit Sub
End If

With rs
.AddNew


!orderid = LCase(orderid.Text)
!productname = LCase(productname.Text)
!producttype = LCase(producttype.Text)
!customername = LCase(customername.Text)
!operatorname = LCase(operatorname.Text)
!destination = LCase(destination.Text)
!price = LCase(price.Text)
!number = LCase(number.Text)
!total = LCase(total.Text)
!transport = LCase(transport.Text)
!pay = LCase(pay.Text)
!orderdate = LCase(orderdate.Text)
!finishdate = LCase(finishdate.Text)
!status = LCase(status.Text)

.Update
End With

MsgBox (newName & " 添加成功! ")
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
Set db = OpenDatabase(App.Path + "/database2.mdb")
Set rs = db.OpenRecordset("sub")
'Dim td As TableDef
If rs.EOF Then
MsgBox "Please Add Someone To The Databse"
Else
rs.MoveFirst
orderid = rs.Fields("orderid")
productname = rs.Fields("productname")
producttype = rs.Fields("producttype")
customername = rs.Fields("customername")
operatorname = rs.Fields("operatorname")
destination = rs.Fields("destination")
price = rs.Fields("price")
number = rs.Fields("number")
total = rs.Fields("total")
transport = rs.Fields("transport")
pay = rs.Fields("pay")
orderdate = rs.Fields("orderdate")
finishdate = rs.Fields("finishdate")
List1 = rs.Fields("status")
End If

'For Each td In db.TableDefs
        
        'If Left$(td.Name, 4) <> "MSys" Then _
            List1.AddItem td.Name
    'Next td

    'db.Close
dbname = App.Path
    If Right$(dbname, 1) <> "\" Then dbname = dbname & "\"
    dbname = dbname & "database2.mdb"
    ' Attach the Data control to the database.
    data1.DatabaseName = dbname 'App.Path&"database2.mdb"
    'Set db = OpenDatabase("f:/test/db1.mdb") '()内是你的数据库所在位置
    'Set rs = db.OpenRecordset("表1") '()内是你数据库里面的表名


End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -