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

📄 cheliangmingcheng.frm

📁 是用VB^开发的办公室车辆使用管理软件
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form cheliangmingcheng 
   Caption         =   "车辆名称"
   ClientHeight    =   5655
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8805
   LinkTopic       =   "Form1"
   ScaleHeight     =   5655
   ScaleWidth      =   8805
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame2 
      Height          =   4575
      Left            =   3240
      TabIndex        =   1
      Top             =   360
      Width           =   5415
      Begin MSFlexGridLib.MSFlexGrid MSF 
         Height          =   3735
         Left            =   120
         TabIndex        =   10
         Top             =   360
         Width           =   5055
         _ExtentX        =   8916
         _ExtentY        =   6588
         _Version        =   393216
         FixedCols       =   0
         AllowUserResizing=   3
      End
   End
   Begin VB.Frame Frame1 
      Height          =   4575
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   2895
      Begin VB.Frame Frame3 
         Height          =   1095
         Left            =   0
         TabIndex        =   11
         Top             =   3480
         Width           =   2895
         Begin VB.CommandButton Command3 
            Caption         =   "修 改"
            Height          =   375
            Left            =   1920
            TabIndex        =   14
            Top             =   360
            Width           =   855
         End
         Begin VB.CommandButton Command2 
            Caption         =   "删 除"
            Height          =   375
            Left            =   1080
            TabIndex        =   13
            Top             =   360
            Width           =   855
         End
         Begin VB.CommandButton Command1 
            Caption         =   "保 存"
            Height          =   375
            Left            =   240
            TabIndex        =   12
            Top             =   360
            Width           =   855
         End
      End
      Begin VB.TextBox Text4 
         Height          =   375
         Left            =   1680
         TabIndex        =   9
         Top             =   2520
         Width           =   855
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   840
         TabIndex        =   8
         Top             =   1800
         Width           =   1215
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   840
         TabIndex        =   7
         Top             =   1200
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   840
         TabIndex        =   6
         Top             =   600
         Width           =   1575
      End
      Begin VB.Label Label4 
         Caption         =   "百公里耗油标准:"
         Height          =   375
         Left            =   240
         TabIndex        =   5
         Top             =   2640
         Width           =   1575
      End
      Begin VB.Label Label3 
         Caption         =   "司机:"
         Height          =   375
         Left            =   240
         TabIndex        =   4
         Top             =   1920
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "车牌:"
         Height          =   375
         Left            =   240
         TabIndex        =   3
         Top             =   1320
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "车型:"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   720
         Width           =   735
      End
   End
End
Attribute VB_Name = "cheliangmingcheng"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Dim Db As Database
Dim result, result1, result2 As Recordset
Dim sql As String

Private Sub Command1_Click()
    If MsgBox("确认保存吗?", vbYesNo, "警告") = vbYes Then
        
         sql = "insert into cheliangmingcheng values('" & Trim(Text1.Text) & "','" & Trim(Text2.Text) & "','" & Trim(Text3.Text) & "','" & Trim(Text4.Text) & "')"
         result.Open sql, con, adOpenStatic, adLockOptimistic
       
'          result.AddNew
'              result!车型 = Trim(Text1.Text)
'              result!车牌 = Trim(Text2.Text)
'              result!司机 = Trim(Text3.Text)
'              result!百公里耗油标准 = Trim(Text4.Text)
'          result.Update
        Call bb
    End If
End Sub

Private Sub Command2_Click()
      If MsgBox("确认删除吗?", vbYesNo, "警告") = vbYes Then
          sql = "delete from cheliangmingcheng where 车型='" & Trim(Text1.Text) & "' and 车牌='" & Trim(Text2.Text) & "'"
          result.Open sql, con, adOpenStatic, adLockOptimistic
        
           Call bb
      End If
End Sub

Private Sub Command3_Click()

          sql = "delete from cheliangmingcheng where 车型='" & Trim(Text1.Text) & "' and 车牌='" & Trim(Text2.Text) & "'"
          result.Open sql, con, adOpenStatic, adLockOptimistic
               
          sql = "insert into cheliangmingcheng values('" & Trim(Text1.Text) & "','" & Trim(Text2.Text) & "','" & Trim(Text3.Text) & "','" & Trim(Text4.Text) & "')"
          result.Open sql, con, adOpenStatic, adLockOptimistic
          Call bb
           
End Sub

Private Sub Form_Load()
'      Set Db = Workspaces(0).OpenDatabase(App.Path & "\cheliang.MDB")
'      Set RS = Db.OpenRecordset("SELECT * FROM cheliangmingcheng")
'       sql = "SELECT * FROM cheliangmingcheng"
'       Set result = Db.OpenRecordset(sql)
'       Call bb
         Move Screen.Width / 2 - cheliangmingcheng.Width / 2, Screen.Height / 2 - cheliangmingcheng.Height / 2
         MSF.FormatString = "  车  型   |^    车  牌   |^  司机 |^ 百公里耗油标准 "
  
          Call aa
         
          Set result = New Recordset
          Set result1 = New Recordset
          Set result2 = New Recordset

          Call bb
    
End Sub
Sub bb()
        MSF.Clear
        MSF.FormatString = "  车  型   |^    车  牌   |^  司机 |^ 百公里耗油标准 "
        MSF.Rows = 2
        sql = "select * from cheliangmingcheng "
        result.Open sql, con, adOpenStatic, adLockOptimistic
        If result.RecordCount <> 0 Then
            result.MoveFirst
            Dim i As Integer
            i = 1
           
            Do While Not result.EOF
                MSF.TextArray(i * MSF.Cols) = Trim(result("车型"))
                MSF.TextArray(i * MSF.Cols + 1) = Trim(result("车牌"))
                MSF.TextArray(i * MSF.Cols + 2) = Trim(result("司机"))
                MSF.TextArray(i * MSF.Cols + 3) = Trim(result("百公里耗油标准"))
                i = i + 1
                MSF.Rows = MSF.Rows + 1
                result.MoveNext
            Loop
       End If
       Text1.Text = ""
       Text2.Text = ""
       Text3.Text = ""
       Text4.Text = ""
      ' Text1.SetFocus
       result.Close
End Sub

Private Sub MSF_DblClick()
      Text1.Text = MSF.TextArray(MSF.Row * MSF.Cols)
      Text2.Text = MSF.TextArray(MSF.Row * MSF.Cols + 1)
      Text3.Text = MSF.TextArray(MSF.Row * MSF.Cols + 2)
      Text4.Text = MSF.TextArray(MSF.Row * MSF.Cols + 3)
End Sub

⌨️ 快捷键说明

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