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

📄 frmuseexpendable.frm

📁 一个vb编的计算机机房管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmUseExpendable 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "消耗品领用"
   ClientHeight    =   3825
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5625
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3825
   ScaleWidth      =   5625
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   3840
      TabIndex        =   7
      Top             =   3000
      Width           =   975
   End
   Begin VB.CommandButton cmdModi 
      Caption         =   "领用"
      Height          =   375
      Left            =   720
      TabIndex        =   6
      Top             =   3000
      Width           =   975
   End
   Begin VB.CommandButton cmdSearch 
      Caption         =   "查询"
      Height          =   375
      Left            =   2280
      TabIndex        =   5
      Top             =   3000
      Width           =   975
   End
   Begin VB.Frame Frame1 
      Height          =   2175
      Left            =   480
      TabIndex        =   0
      Top             =   360
      Width           =   4455
      Begin VB.TextBox txtECount 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   1800
         MaxLength       =   5
         TabIndex        =   2
         Top             =   1200
         Width           =   1575
      End
      Begin VB.TextBox txtEName 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   1800
         MaxLength       =   10
         TabIndex        =   1
         Top             =   480
         Width           =   1575
      End
      Begin VB.Label Label6 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "数量:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   285
         Left            =   840
         TabIndex        =   4
         Top             =   1200
         Width           =   945
      End
      Begin VB.Label Label1 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "名称:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   285
         Left            =   840
         TabIndex        =   3
         Top             =   480
         Width           =   945
      End
   End
End
Attribute VB_Name = "frmUseExpendable"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'ENAME Not VarChar(30), --消耗品名称
'price Not Money, --价格
'ECOUNT INT NULL,  --数量
'STOREID CHAR(1) REFERENCES STORE(STOREID))   --存储地点
Private objExpendable As New clsExpendable



Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdModi_Click()
'修改消耗品
    
    If checkForm() Then
        Call getFormValues
        If objExpendable.Use() Then
            MsgBox "数据修改成功!"
        Else
            MsgBox "数据修改失败!"
        End If
    End If
    Call resetForm(Me)
End Sub

Private Sub cmdSearch_Click()
'查询消耗品
    Dim strCondition As String
    Dim rsq As New ADODB.Recordset
    Dim i As Integer
    If Trim(Me.txtEName.Text) = "" Then
        MsgBox "请填写消耗品名称!"
        Me.txtEName.SetFocus
        Exit Sub
    End If
    objExpendable.ENAME = Trim(Me.txtEName.Text)
    strCondition = "EName='" & Trim(Me.txtEName.Text) & "'"
    Set rsq = objDBOpt.getRecord("Expendable", "*", strCondition)
    If rsq Is Nothing Then
        MsgBox "查询失败!"
    ElseIf rsq.EOF And rsq.BOF Then
        MsgBox "没有符合条件的记录!"
    Else
        Me.txtECount.Text = setNotNull(rsq.Fields("ECount").Value, 0)
    End If
    
End Sub

Private Sub Form_Load()
    Call resetForm(Me)
End Sub
Private Sub getFormValues()

   objExpendable.ENAME = Me.txtEName.Text
   objExpendable.ECOUNT = Me.txtECount.Text

End Sub
Private Function checkForm() As Boolean
    If Trim(Me.txtEName.Text) = "" Then
        MsgBox "消耗品名称不能为空!"
        Me.txtEName.SetFocus
        checkForm = False
        Exit Function
    End If
    If IsNumeric(Me.txtECount.Text) = False Or InStr(1, Me.txtECount.Text, ".") > 0 Or InStr(1, Me.txtECount.Text, "-") > 0 Then
        MsgBox "消耗品数量应该为整数!"
        Me.txtECount.SetFocus
        checkForm = False
        Exit Function
    End If
    

    
    checkForm = True
End Function

⌨️ 快捷键说明

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