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

📄 frm_addcustomer.frm

📁 这是一个基于VB和SQL开发的管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Begin VB.Form Frm_addCus 
   Caption         =   "添加客户信息"
   ClientHeight    =   4200
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6480
   LinkTopic       =   "Form1"
   ScaleHeight     =   4200
   ScaleWidth      =   6480
   StartUpPosition =   3  '窗口缺省
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   360
      Top             =   3720
      Visible         =   0   'False
      Width           =   2055
      _ExtentX        =   3625
      _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=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=CarSaleSys"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "CarSaleSys"
      OtherAttributes =   ""
      UserName        =   "sa"
      Password        =   "sa"
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Cmd_Cancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   4920
      TabIndex        =   12
      Top             =   3720
      Width           =   975
   End
   Begin VB.CommandButton Cmd_add 
      Caption         =   "确定"
      Height          =   375
      Left            =   3240
      TabIndex        =   11
      Top             =   3720
      Width           =   975
   End
   Begin VB.TextBox cus_name 
      Appearance      =   0  'Flat
      Height          =   375
      Left            =   1200
      TabIndex        =   1
      Top             =   360
      Width           =   1455
   End
   Begin VB.TextBox cus_job 
      Appearance      =   0  'Flat
      Height          =   375
      Left            =   1200
      TabIndex        =   7
      Top             =   1800
      Width           =   1455
   End
   Begin VB.TextBox cus_age 
      Appearance      =   0  'Flat
      Height          =   375
      Left            =   1200
      TabIndex        =   5
      Top             =   1320
      Width           =   1455
   End
   Begin VB.TextBox cus_sex 
      Appearance      =   0  'Flat
      Height          =   375
      Left            =   1200
      TabIndex        =   3
      Top             =   840
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Height          =   3615
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   6255
      Begin VB.TextBox cus_info 
         Appearance      =   0  'Flat
         Height          =   735
         Left            =   1080
         TabIndex        =   10
         Top             =   2760
         Width           =   5055
      End
      Begin VB.TextBox cus_address 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   1080
         TabIndex        =   9
         Top             =   2280
         Width           =   5055
      End
      Begin VB.TextBox buycar_name 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   3600
         TabIndex        =   2
         Top             =   360
         Width           =   2535
      End
      Begin VB.TextBox cus_num 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   3600
         TabIndex        =   8
         Top             =   1800
         Width           =   2535
      End
      Begin VB.TextBox cus_tel 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   3600
         TabIndex        =   6
         Top             =   1320
         Width           =   2535
      End
      Begin VB.TextBox buycar_price 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   3600
         TabIndex        =   4
         Top             =   840
         Width           =   2535
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         Caption         =   "备    注"
         Height          =   195
         Index           =   9
         Left            =   240
         TabIndex        =   22
         Top             =   2880
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户住址"
         Height          =   195
         Index           =   8
         Left            =   240
         TabIndex        =   21
         Top             =   2400
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "身份证号"
         Height          =   195
         Index           =   7
         Left            =   2760
         TabIndex        =   20
         Top             =   1920
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户电话"
         Height          =   195
         Index           =   6
         Left            =   2760
         TabIndex        =   19
         Top             =   1440
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "购车价格"
         Height          =   195
         Index           =   5
         Left            =   2760
         TabIndex        =   18
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "购车型号"
         Height          =   195
         Index           =   4
         Left            =   2760
         TabIndex        =   17
         Top             =   480
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户职业"
         Height          =   195
         Index           =   3
         Left            =   240
         TabIndex        =   16
         Top             =   1920
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户年龄"
         Height          =   195
         Index           =   1
         Left            =   240
         TabIndex        =   15
         Top             =   1440
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户性别"
         Height          =   195
         Index           =   2
         Left            =   240
         TabIndex        =   14
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户姓名"
         Height          =   300
         Index           =   0
         Left            =   240
         TabIndex        =   13
         Top             =   480
         Width           =   720
      End
   End
End
Attribute VB_Name = "Frm_addCus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_add_Click()

    Dim txtId As Integer
    
    Adodc1.RecordSource = "SELECT * FROM Customer Order by Customer_id desc"
    Adodc1.Refresh
    If Adodc1.Recordset.EOF = True Then
        txtId = 1
    Else
        txtId = Adodc1.Recordset.Fields(0) + 1
    End If
 
    
    If cus_name = "" Then
       MsgBox ("请输入客户名字")
       Exit Sub
    End If
    
    If buycar_name = "" Then
       MsgBox ("请输入汽车型号")
       Exit Sub
    Else
          Adodc1.RecordSource = "select * from Car where Car_name = '" + Trim(buycar_name)
          If Adodc1.Recordset.BOF = False Then
             MsgBox ("没有的输入汽车型号")
             buycar_name.SetFocus
          End If
       
    End If
    
    If buycar_price = "" Then
       MsgBox ("请输入汽车价格")
       Exit Sub
    End If
    
    
    '增加新车
    Adodc1.Recordset.AddNew
    Adodc1.Recordset.Fields(0).Value = Val(txtId)
    Adodc1.Recordset.Fields(1).Value = Trim(cus_name.Text)
    Adodc1.Recordset.Fields(2).Value = Trim(cus_sex.Text)
    Adodc1.Recordset.Fields(3).Value = Val(Trim(cus_age.Text))
    Adodc1.Recordset.Fields(4).Value = Trim(cus_job.Text)
    Adodc1.Recordset.Fields(5).Value = Trim(cus_num.Text)
    Adodc1.Recordset.Fields(6).Value = Trim(cus_tel.Text)
    Adodc1.Recordset.Fields(7).Value = Trim(cus_address.Text)
    Adodc1.Recordset.Fields(8).Value = Trim(buycar_name.Text)
    Adodc1.Recordset.Fields(9).Value = Trim(buycar_price.Text)
    Adodc1.Recordset.Fields(10).Value = Trim(cus_info.Text)
    
    
    
    Adodc1.Recordset.Update
    Adodc1.Refresh
    MsgBox "客户信息增加完成"
    Unload Me
End Sub

Private Sub Cmd_Cancel_Click()
    Unload Me
End Sub

⌨️ 快捷键说明

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