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

📄 form1.frm

📁 一个ERP系统可以用来学习之用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLeibieEdit 
   Caption         =   "类别编辑窗体"
   ClientHeight    =   3975
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5220
   LinkTopic       =   "Form1"
   ScaleHeight     =   3975
   ScaleWidth      =   5220
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdExit 
      Caption         =   "退出"
      Height          =   375
      Left            =   3600
      TabIndex        =   9
      Top             =   3360
      Width           =   975
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   2280
      TabIndex        =   8
      Top             =   3360
      Width           =   975
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定"
      Height          =   375
      Left            =   960
      TabIndex        =   7
      Top             =   3360
      Width           =   975
   End
   Begin VB.TextBox txtbeizhu 
      Height          =   375
      Left            =   2160
      TabIndex        =   6
      Top             =   2400
      Width           =   2055
   End
   Begin VB.TextBox txtLbname 
      Height          =   375
      Left            =   2160
      TabIndex        =   5
      Top             =   1800
      Width           =   2055
   End
   Begin VB.TextBox txtLbID 
      Enabled         =   0   'False
      Height          =   375
      Left            =   2160
      TabIndex        =   4
      Top             =   1200
      Width           =   2055
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "备注"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   960
      TabIndex        =   3
      Top             =   2400
      Width           =   1095
   End
   Begin VB.Label Label3 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "类别名称"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   2
      Top             =   1800
      Width           =   1335
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "类别ID"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   960
      TabIndex        =   1
      Top             =   1200
      Width           =   1095
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "类别编辑"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   21.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1320
      TabIndex        =   0
      Top             =   240
      Width           =   2415
   End
End
Attribute VB_Name = "frmLeibieEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public oridaihao As String
Public modify As Boolean

Private Function check() As Boolean
    If Trim(txtLbname) = "" Then
        MsgBox "物料类别不能为空,请输入"
        txtLbname.SetFocus
        check = False
        Exit Function
    End If
    
        check = True
End Function

Private Sub cmdCancel_Click()
  If txtLbname.Enabled = False Then
      Exit Sub
  Else
     txtLbname.Text = ""
     txtBeizhu.Text = ""
  End If
End Sub

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    If check = False Then
        Exit Sub
    End If
    
  With myLeiBie
        .LeiBieId = txtLbID.Text
        .LbName = txtLbname.Text
        .Beizhu = txtBeizhu.Text
     If modify = False Then
         If .in_db(txtLbname) = True Then
                MsgBox "类别代号已经使用,请重新输入"
                txtLbname.SetFocus
                Exit Sub
         Else
                .insert
                MsgBox "添加成功"
         End If
     Else
            .update (oridaihao)
            MsgBox "修改成功"
     End If
     
  End With
        Unload Me
        frmleibie.Show 1
End Sub

Private Sub Form_Load()
    frmLeibieEdit.BackColor = RGB(39, 160, 237)
    
End Sub

⌨️ 快捷键说明

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