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

📄 frmwuliaomuluedit.frm

📁 一个ERP系统可以用来学习之用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmwuliaomuluEdit 
   Caption         =   "物料目录编辑"
   ClientHeight    =   5295
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7875
   BeginProperty Font 
      Name            =   "隶书"
      Size            =   14.25
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   5295
   ScaleWidth      =   7875
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdleibie 
      Caption         =   "..."
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6480
      TabIndex        =   19
      Top             =   1920
      Width           =   495
   End
   Begin VB.CommandButton cmbExit 
      Caption         =   "退出"
      Height          =   495
      Left            =   5040
      TabIndex        =   18
      Top             =   4680
      Width           =   735
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   495
      Left            =   2760
      TabIndex        =   17
      Top             =   4680
      Width           =   735
   End
   Begin VB.TextBox txtbeizhu 
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1245
      Left            =   1440
      TabIndex        =   16
      Top             =   3120
      Width           =   5535
   End
   Begin VB.TextBox txtprice 
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   5520
      TabIndex        =   15
      Top             =   2520
      Width           =   1455
   End
   Begin VB.TextBox txtuntil 
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   3480
      TabIndex        =   14
      Top             =   2520
      Width           =   975
   End
   Begin VB.TextBox txtguige 
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   1440
      TabIndex        =   13
      Top             =   2520
      Width           =   1215
   End
   Begin VB.TextBox txtleibie 
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   4800
      TabIndex        =   12
      Top             =   1920
      Width           =   1455
   End
   Begin VB.TextBox txtname 
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   1440
      TabIndex        =   11
      Top             =   1920
      Width           =   1575
   End
   Begin VB.TextBox txtdaihao 
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   4560
      TabIndex        =   10
      Top             =   1320
      Width           =   2415
   End
   Begin VB.TextBox txtwlid 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   1440
      TabIndex        =   9
      Top             =   1320
      Width           =   1575
   End
   Begin VB.Label Label9 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "备注"
      Height          =   375
      Left            =   0
      TabIndex        =   8
      Top             =   3120
      Width           =   1335
   End
   Begin VB.Label Label8 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "物料名称"
      Height          =   255
      Left            =   0
      TabIndex        =   7
      Top             =   1920
      Width           =   1335
   End
   Begin VB.Label Label7 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "物料代号"
      Height          =   375
      Left            =   3120
      TabIndex        =   6
      Top             =   1320
      Width           =   1335
   End
   Begin VB.Label Label6 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "规格"
      Height          =   255
      Left            =   0
      TabIndex        =   5
      Top             =   2520
      Width           =   1335
   End
   Begin VB.Label Label5 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "类别"
      Height          =   375
      Left            =   3360
      TabIndex        =   4
      Top             =   1920
      Width           =   1335
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "单价"
      Height          =   255
      Left            =   4680
      TabIndex        =   3
      Top             =   2520
      Width           =   735
   End
   Begin VB.Label Label3 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "单位"
      Height          =   375
      Left            =   2760
      TabIndex        =   2
      Top             =   2520
      Width           =   615
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "物料ID"
      Height          =   255
      Left            =   0
      TabIndex        =   1
      Top             =   1320
      Width           =   1335
   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          =   495
      Left            =   1920
      TabIndex        =   0
      Top             =   240
      Width           =   4095
   End
End
Attribute VB_Name = "frmwuliaomuluEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public oriWLdaihao As String
Public modify As Boolean

Private Sub cmbExit_Click()
    Unload Me
End Sub

Private Sub cmdleibie_Click()
    frmleibie.Show 1
   
End Sub

Private Sub cmdOK_Click()
    If check = False Then
        Exit Sub
    End If
    
    With Mywlml
        .wlid = Trim(txtwlid.Text)
        .wldaihao = Trim(txtdaihao.Text)
        .wlname = Trim(txtname.Text)
        .leibie = Trim(txtleibie.Text)
        .guige = Trim(txtguige.Text)
        .wluntil = Trim(txtuntil.Text)
        .price = Trim(txtprice.Text)
        .Beizhu = Trim(txtBeizhu.Text)
        
        If modify = False Then
            If .in_db(txtdaihao.Text) = True Then
                MsgBox "物料代号已存在,请重新输入"
                txtdaihao.SetFocus
                'txtdaihao.SelStart = 0
                'txtdaihao.SelLength = Len(txtdaihao)
                Exit Sub
            Else
                .inserts
                MsgBox "添加成功"
            End If
        Else
            .update (oriWLdaihao)
            MsgBox "修改成功"
        End If
    End With
    
        Unload Me
        frmWuliaomulu.Show
                
End Sub

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

End Sub


Private Function check() As Boolean
    If Trim(txtdaihao) = "" Then
        MsgBox "物料代号不能为空"
        txtdaihao.SetFocus
        check = False
        Exit Function
        
    End If
    
    If Trim(txtname) = "" Then
        MsgBox "物料名称不能为空"
        txtname.SetFocus
        check = False
        Exit Function
    End If
    
    If Trim(txtleibie) = "" Then
        MsgBox "类别不能为空"
        txtleibie.SetFocus
        check = False
        Exit Function
    End If
    
    If Trim(txtguige) = "" Then
        MsgBox "规格不能为空"
        txtguige.SetFocus
        check = False
        Exit Function
    End If
    
    If Trim(txtuntil) = "" Then
        MsgBox "单位不能为空"
        txtuntil.SetFocus
        check = False
        Exit Function
    End If
    
    If Trim(txtprice) = "" Then
        MsgBox "单价不能为空"
        txtprice.SetFocus
        check = False
        Exit Function
    End If
    
    If Not IsNumeric(txtprice) Then
        MsgBox "单价必须为数字"
        txtprice.SetFocus
        txtprice.SelStart = 0
        txtprice.SelLength = Len(txtprice)
        check = False
        Exit Function
    End If
    
    check = True
     
End Function


⌨️ 快捷键说明

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