frmdiscardappedit.frm

来自「vb与access数据库的操作实例」· FRM 代码 · 共 334 行

FRM
334
字号
VERSION 5.00
Begin VB.Form FrmDiscardAppEdit 
   Caption         =   "审批设备报废申请"
   ClientHeight    =   6360
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5895
   LinkTopic       =   "Form1"
   ScaleHeight     =   6360
   ScaleWidth      =   5895
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Cmd_No 
      Caption         =   "不同意报废"
      Height          =   375
      Left            =   2400
      TabIndex        =   31
      Top             =   5880
      Width           =   1215
   End
   Begin VB.Frame Frame3 
      Caption         =   "审批意见"
      Height          =   1695
      Left            =   120
      TabIndex        =   24
      Top             =   4080
      Width           =   5655
      Begin VB.TextBox txtResult 
         Height          =   690
         Left            =   960
         TabIndex        =   29
         Top             =   840
         Width           =   4455
      End
      Begin VB.TextBox txtChkDate 
         Height          =   330
         Left            =   960
         TabIndex        =   26
         Top             =   315
         Width           =   1575
      End
      Begin VB.TextBox txtChecker 
         Enabled         =   0   'False
         Height          =   330
         Left            =   3840
         TabIndex        =   25
         Top             =   315
         Width           =   1575
      End
      Begin VB.Label Label13 
         AutoSize        =   -1  'True
         Caption         =   "审批意见"
         Height          =   180
         Left            =   120
         TabIndex        =   30
         Top             =   840
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "审批日期"
         Height          =   180
         Left            =   120
         TabIndex        =   28
         Top             =   390
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "审 批 人"
         Height          =   180
         Left            =   3000
         TabIndex        =   27
         Top             =   390
         Width           =   720
      End
   End
   Begin VB.TextBox txtCreateDate 
      Enabled         =   0   'False
      Height          =   330
      Left            =   1080
      TabIndex        =   23
      Top             =   165
      Width           =   1575
   End
   Begin VB.Frame Frame2 
      Caption         =   "报废信息"
      Height          =   1575
      Left            =   120
      TabIndex        =   15
      Top             =   2400
      Width           =   5655
      Begin VB.TextBox txtDSum 
         Enabled         =   0   'False
         Height          =   330
         Left            =   3840
         TabIndex        =   18
         Text            =   "0"
         Top             =   240
         Width           =   1575
      End
      Begin VB.TextBox txtReason 
         Enabled         =   0   'False
         Height          =   690
         Left            =   960
         TabIndex        =   17
         Top             =   720
         Width           =   4455
      End
      Begin VB.TextBox txtDCount 
         Enabled         =   0   'False
         Height          =   330
         Left            =   960
         TabIndex        =   16
         Text            =   "1"
         Top             =   240
         Width           =   1575
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "报废原因"
         Height          =   180
         Left            =   120
         TabIndex        =   21
         Top             =   720
         Width           =   720
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "折算金额"
         Height          =   180
         Left            =   3000
         TabIndex        =   20
         Top             =   315
         Width           =   720
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "报废数量"
         Height          =   180
         Left            =   120
         TabIndex        =   19
         Top             =   315
         Width           =   720
      End
   End
   Begin VB.TextBox txtUserName 
      Enabled         =   0   'False
      Height          =   330
      Left            =   3960
      TabIndex        =   11
      Top             =   165
      Width           =   1575
   End
   Begin VB.CommandButton Cmd_Cancel 
      Caption         =   "取 消"
      Height          =   375
      Left            =   4200
      TabIndex        =   8
      Top             =   5880
      Width           =   1215
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "同意报废"
      Height          =   375
      Left            =   600
      TabIndex        =   7
      Top             =   5880
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Caption         =   "设备信息"
      Height          =   1695
      Left            =   120
      TabIndex        =   0
      Top             =   600
      Width           =   5655
      Begin VB.TextBox txtId 
         Height          =   330
         Left            =   960
         TabIndex        =   13
         Top             =   285
         Width           =   1575
      End
      Begin VB.TextBox txtUnit 
         Height          =   330
         Left            =   3840
         TabIndex        =   10
         Top             =   1200
         Width           =   1575
      End
      Begin VB.TextBox txtTypeName 
         Height          =   330
         Left            =   960
         TabIndex        =   9
         Top             =   1200
         Width           =   1575
      End
      Begin VB.TextBox txtModel 
         Height          =   330
         Left            =   3840
         TabIndex        =   5
         Top             =   765
         Width           =   1575
      End
      Begin VB.TextBox txtName 
         Height          =   330
         Left            =   960
         TabIndex        =   2
         Top             =   765
         Width           =   1575
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "设备编号"
         Height          =   180
         Left            =   120
         TabIndex        =   14
         Top             =   360
         Width           =   720
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "分类名称"
         Height          =   180
         Left            =   120
         TabIndex        =   6
         Top             =   1275
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "设备型号"
         Height          =   180
         Left            =   3000
         TabIndex        =   4
         Top             =   840
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "计量单位"
         Height          =   180
         Left            =   3000
         TabIndex        =   3
         Top             =   1245
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "设备名称"
         Height          =   180
         Left            =   120
         TabIndex        =   1
         Top             =   840
         Width           =   720
      End
   End
   Begin VB.Label Label12 
      AutoSize        =   -1  'True
      Caption         =   "申请日期"
      Height          =   180
      Left            =   240
      TabIndex        =   22
      Top             =   240
      Width           =   720
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      Caption         =   "申 请 人"
      Height          =   180
      Left            =   3120
      TabIndex        =   12
      Top             =   240
      Width           =   720
   End
End
Attribute VB_Name = "FrmDiscardAppEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OriId As Long  '报废编号

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

Private Sub Cmd_No_Click()
  '如果为提交,则需要检查用户录入数据的有效性
  If Len(Trim(txtChkDate)) = 0 Then
    MsgBox ("请选择审批日期")
    txtChkDate.SetFocus
    Exit Sub
  End If
  If Len(Trim(txtResult)) = 0 Then
    MsgBox "请输入处理意见"
    txtResult.SetFocus
    Exit Sub
  End If

  '把用户录入的数据赋值到数据库对象变量中
  With MyDiscard
    .CheckDate = MakeStr(txtChkDate)
    .Result = MakeStr(txtResult)
    .Status = "不同意"
    .UpdateApproval (OriId)
  End With
  '关闭窗口
  Unload Me
End Sub
  
'如果为同意报废,则需要检查用户录入数据的有效性
Private Sub Cmd_OK_Click()
  If Len(Trim(txtChkDate)) = 0 Then
    MsgBox ("请选择审批日期")
    txtChkDate.SetFocus
    Exit Sub
  End If
  If Len(Trim(txtResult)) = 0 Then
    MsgBox "请输入处理意见"
    txtResult.SetFocus
    Exit Sub
  End If
  '把用户录入的数据赋值到数据库对象变量中
  With MyDiscard
    .CheckDate = MakeStr(txtChkDate)
    .Result = MakeStr(txtResult)
    .Status = "同意"
    .UpdateApproval (OriId)
  End With
  '关闭窗口
  Unload Me
End Sub

⌨️ 快捷键说明

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