frmoutcar.frm

来自「企业事务管理系统(程序+打包)是《数据库系统开发项目方案精解系列丛书VB数据库管」· FRM 代码 · 共 263 行

FRM
263
字号
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmOutCar 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "修改出车记录"
   ClientHeight    =   4035
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6645
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4035
   ScaleWidth      =   6645
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox txtOutID 
      Height          =   495
      Left            =   360
      TabIndex        =   19
      Top             =   3360
      Visible         =   0   'False
      Width           =   735
   End
   Begin VB.CommandButton cmdOK 
      Height          =   495
      Left            =   1440
      Picture         =   "frmOutCar.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   18
      Top             =   3360
      Width           =   1215
   End
   Begin VB.CommandButton cmdCancel 
      Height          =   495
      Left            =   3900
      Picture         =   "frmOutCar.frx":0540
      Style           =   1  'Graphical
      TabIndex        =   17
      Top             =   3360
      Width           =   1215
   End
   Begin VB.TextBox txtOutDep 
      Appearance      =   0  'Flat
      Height          =   330
      Left            =   4680
      TabIndex        =   5
      Top             =   405
      Width           =   1635
   End
   Begin VB.TextBox txtOutDistance 
      Appearance      =   0  'Flat
      Height          =   330
      Left            =   5160
      TabIndex        =   4
      Top             =   1125
      Width           =   1155
   End
   Begin VB.TextBox txtOutReason 
      Appearance      =   0  'Flat
      Height          =   330
      Left            =   840
      TabIndex        =   3
      Top             =   1125
      Width           =   3735
   End
   Begin VB.TextBox txtOutNote 
      Appearance      =   0  'Flat
      Height          =   1350
      Left            =   840
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   2
      Top             =   1545
      Width           =   5475
   End
   Begin VB.TextBox TxtOutPlace 
      Appearance      =   0  'Flat
      Height          =   330
      Left            =   4680
      TabIndex        =   1
      Top             =   765
      Width           =   1635
   End
   Begin MSComCtl2.DTPicker DTPOutEndDate 
      Height          =   330
      Left            =   1260
      TabIndex        =   6
      Top             =   705
      Width           =   1395
      _ExtentX        =   2461
      _ExtentY        =   582
      _Version        =   393216
      Format          =   27000833
      CurrentDate     =   38032
   End
   Begin MSComCtl2.DTPicker DTPOutStartDate 
      Height          =   330
      Left            =   1260
      TabIndex        =   7
      Top             =   360
      Width           =   1395
      _ExtentX        =   2461
      _ExtentY        =   582
      _Version        =   393216
      Format          =   27000833
      CurrentDate     =   38032
   End
   Begin MSComCtl2.DTPicker DTPOutEndTime 
      Height          =   330
      Left            =   2700
      TabIndex        =   8
      Top             =   705
      Width           =   915
      _ExtentX        =   1614
      _ExtentY        =   582
      _Version        =   393216
      CustomFormat    =   "H:mm"
      Format          =   27000835
      UpDown          =   -1  'True
      CurrentDate     =   38032
   End
   Begin MSComCtl2.DTPicker DTPOutStartTime 
      Height          =   330
      Left            =   2700
      TabIndex        =   9
      Top             =   360
      Width           =   915
      _ExtentX        =   1614
      _ExtentY        =   582
      _Version        =   393216
      CustomFormat    =   "H:mm"
      Format          =   27000835
      UpDown          =   -1  'True
      CurrentDate     =   38032
   End
   Begin VB.Label Label16 
      AutoSize        =   -1  'True
      Caption         =   "备注"
      Height          =   180
      Left            =   360
      TabIndex        =   16
      Top             =   1620
      Width           =   360
   End
   Begin VB.Label Label17 
      AutoSize        =   -1  'True
      Caption         =   "使用单位"
      Height          =   180
      Left            =   3840
      TabIndex        =   15
      Top             =   480
      Width           =   720
   End
   Begin VB.Label Label18 
      AutoSize        =   -1  'True
      Caption         =   "事由"
      Height          =   180
      Left            =   360
      TabIndex        =   14
      Top             =   1200
      Width           =   360
   End
   Begin VB.Label Label19 
      AutoSize        =   -1  'True
      Caption         =   "里程"
      Height          =   180
      Left            =   4725
      TabIndex        =   13
      Top             =   1200
      Width           =   360
   End
   Begin VB.Label Label20 
      AutoSize        =   -1  'True
      Caption         =   "地点"
      Height          =   180
      Left            =   4185
      TabIndex        =   12
      Top             =   840
      Width           =   360
   End
   Begin VB.Label Label23 
      AutoSize        =   -1  'True
      Caption         =   "出发时间"
      Height          =   180
      Left            =   360
      TabIndex        =   11
      Top             =   420
      Width           =   720
   End
   Begin VB.Label Label24 
      AutoSize        =   -1  'True
      Caption         =   "返回时间"
      Height          =   180
      Left            =   360
      TabIndex        =   10
      Top             =   780
      Width           =   720
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      BorderStyle     =   1  'Fixed Single
      Height          =   3015
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   6435
   End
End
Attribute VB_Name = "frmOutCar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    Dim rst As New ADODB.Recordset
    Dim strsql As String
    
    If Me.DTPOutStartDate > Me.DTPOutEndDate Then '出车时间判断
        MsgBox "出车日期不可能大于返回日期", vbCritical, "出车管理"
        Exit Sub
    End If
    If Me.DTPOutStartDate = Me.DTPOutEndDate Then
        If Me.DTPOutStartTime >= Me.DTPOutEndTime Then
            MsgBox "出车时间必须小于返回时间", vbCritical, "出车管理"
            Exit Sub
        End If
    End If
    If IsNumeric(Me.txtOutDistance) = False And _
        Me.txtOutDistance <> "" Then
        MsgBox "里程数必须填写数字!", vbExclamation, "购车记录"
        Exit Sub                            '里程如果填写必须是数字
    End If
    If MsgBox("确定要修改这些数据吗?", vbYesNo) = vbNo Then
        Exit Sub                            '提问是否真要添加
    End If
    strsql = "select * from tbl_outcar where outid=" & Me.txtOutID
    rst.Open strsql, CnnDataBase, adOpenDynamic, adLockOptimistic
    rst!OutStartDate = Me.DTPOutStartDate   '修改出车记录
    rst!OutStartTime = Me.DTPOutStartTime.Value '出车时间
    rst!OutEndDate = Me.DTPOutEndDate
    rst!OutEndTime = Me.DTPOutEndTime
    rst!OutDep = Me.txtOutDep
    rst!OutPlace = Me.TxtOutPlace
    rst!OutReason = Me.txtOutReason
    If Me.txtOutDistance <> "" Then         '里程为空则记录0
        rst!outdistance = Me.txtOutDistance
    Else
        rst!outdistance = 0
    End If
    rst!OutNote = Me.txtOutNote
    rst.Update                              '修改完成
    MsgBox "出车记录修改成功!", , "完成"
    Unload Me
End Sub

⌨️ 快捷键说明

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