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

📄 frmproductedit.frm

📁 一个小的企业销售管理系统,希望对大家有所帮助有所帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmProductEdit 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑产品信息"
   ClientHeight    =   3390
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3510
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3390
   ScaleWidth      =   3510
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame1 
      Height          =   2415
      Left            =   240
      TabIndex        =   7
      Top             =   120
      Width           =   3015
      Begin VB.TextBox txtId 
         Height          =   270
         Left            =   1320
         MaxLength       =   50
         TabIndex        =   0
         Top             =   195
         Width           =   1455
      End
      Begin VB.TextBox txtName 
         Height          =   270
         Left            =   1320
         MaxLength       =   100
         TabIndex        =   1
         Top             =   615
         Width           =   1455
      End
      Begin VB.TextBox txtMark 
         Height          =   270
         Left            =   1320
         MaxLength       =   50
         TabIndex        =   2
         Top             =   1035
         Width           =   1455
      End
      Begin VB.TextBox txtStyle 
         Height          =   270
         Left            =   1320
         MaxLength       =   100
         TabIndex        =   3
         Top             =   1455
         Width           =   1455
      End
      Begin VB.TextBox txtUnit 
         Height          =   270
         Left            =   1320
         MaxLength       =   20
         TabIndex        =   4
         Top             =   1875
         Width           =   1455
      End
      Begin VB.Label Label12 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "产品商标"
         Height          =   180
         Left            =   240
         TabIndex        =   12
         Top             =   1080
         Width           =   720
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "产品名称"
         Height          =   180
         Left            =   240
         TabIndex        =   11
         Top             =   660
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "产品编号"
         Height          =   180
         Left            =   240
         TabIndex        =   10
         Top             =   240
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "产品型号"
         Height          =   180
         Left            =   240
         TabIndex        =   9
         Top             =   1500
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "计量单位"
         Height          =   180
         Left            =   240
         TabIndex        =   8
         Top             =   1920
         Width           =   720
      End
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   400
      Left            =   325
      MouseIcon       =   "FrmProductEdit.frx":0000
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   2760
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Cancel 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   400
      Left            =   1885
      MouseIcon       =   "FrmProductEdit.frx":030A
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   2760
      Width           =   1300
   End
End
Attribute VB_Name = "FrmProductEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public ClickOK As Boolean
Public OriId As String

Private Sub Cmd_OK_Click()
  Dim TmpId As String
  
  If Trim(txtId) = "" Then
    MsgBox "请输入产品编号"
    Exit Sub
  End If
  
  If Trim(txtName) = "" Then
    MsgBox "请输入产品名称"
    Exit Sub
  End If
  
  TmpId = MakeStr(txtId)
  '判断产品编号是否已经存在
  If Modify = False Or OriId <> Trim(txtId) Then
    If MyPro.In_DB(TmpId) = True Then
      MsgBox "产品编号“" + Trim(txtId) + "”已经存在,请重新输入"
      txtId.SetFocus
      txtId.SelStart = 0
      txtId.SelLength = Len(txtId)
      Exit Sub
    End If
  End If
  
  With MyPro
  .ProId = TmpId
  .ProName = MakeStr(txtName)
  .ProMark = MakeStr(txtMark)
  .ProStyle = MakeStr(txtStyle)
  .ProUnit = MakeStr(txtUnit)
  
  If Modify = False Then
    .Insert
  Else
    .Update (OriId)
  End If
  End With
  ClickOK = True
  Unload Me
End Sub

Private Sub Cmd_Cancel_Click()
  ClickOK = False
  Unload Me
End Sub

Private Sub txtId_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtName_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtMark_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtStyle_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtUnit_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

⌨️ 快捷键说明

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