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

📄 frmcltedit.frm

📁 电脑销售管理系统是典型的信息管理系统(MIS)
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmcltedit 
   Caption         =   "客户信息编辑"
   ClientHeight    =   3690
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6465
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3690
   ScaleMode       =   0  'User
   ScaleWidth      =   8972.26
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmd_cancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   4080
      TabIndex        =   7
      Top             =   3120
      Width           =   1215
   End
   Begin VB.CommandButton cmd_ok 
      Caption         =   "确定"
      Height          =   375
      Left            =   960
      TabIndex        =   6
      Top             =   3120
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Height          =   2655
      Left            =   120
      TabIndex        =   8
      Top             =   120
      Width           =   6135
      Begin VB.TextBox txtfax 
         Height          =   270
         Left            =   3840
         TabIndex        =   18
         Top             =   1506
         Width           =   2055
      End
      Begin VB.TextBox txtphone 
         Height          =   270
         Left            =   1200
         TabIndex        =   17
         Top             =   1506
         Width           =   1695
      End
      Begin VB.ComboBox combotype 
         Height          =   300
         ItemData        =   "frmcltedit.frx":0000
         Left            =   1080
         List            =   "frmcltedit.frx":000A
         TabIndex        =   1
         Top             =   652
         Width           =   1695
      End
      Begin VB.TextBox txtdescribe 
         Height          =   615
         Left            =   1080
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   5
         Top             =   1920
         Width           =   4815
      End
      Begin VB.TextBox txtaddr 
         Height          =   270
         Left            =   1080
         TabIndex        =   3
         Top             =   1094
         Width           =   1695
      End
      Begin VB.TextBox txtorg 
         Height          =   270
         Left            =   1080
         TabIndex        =   0
         Top             =   240
         Width           =   4815
      End
      Begin VB.TextBox txtcode 
         Height          =   270
         Left            =   3840
         TabIndex        =   4
         Top             =   1094
         Width           =   2055
      End
      Begin VB.TextBox txtcontact 
         Height          =   270
         Left            =   3840
         TabIndex        =   2
         Top             =   667
         Width           =   2055
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "客户类别"
         Height          =   180
         Left            =   120
         TabIndex        =   16
         Top             =   660
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "联系人"
         Height          =   180
         Left            =   3000
         TabIndex        =   15
         Top             =   660
         Width           =   540
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "联系电话"
         Height          =   180
         Left            =   120
         TabIndex        =   14
         Top             =   1515
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "通信地址"
         Height          =   180
         Left            =   120
         TabIndex        =   13
         Top             =   1095
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户单位"
         Height          =   180
         Left            =   120
         TabIndex        =   12
         Top             =   240
         Width           =   720
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "电话传真"
         Height          =   180
         Left            =   3000
         TabIndex        =   11
         Top             =   1515
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "邮政编码"
         Height          =   180
         Left            =   3000
         TabIndex        =   10
         Top             =   1095
         Width           =   720
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "描述信息"
         Height          =   180
         Left            =   120
         TabIndex        =   9
         Top             =   1950
         Width           =   720
      End
   End
End
Attribute VB_Name = "frmcltedit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriId As Long
Public OriName As String

Private Sub Cmd_OK_Click()
  '检查录入数据的有效性
  If Trim(txtorg) = "" Then
    MsgBox "请输入客户单位"
    txtorg.SetFocus
    Exit Sub
  End If
  '把用户录入的数据赋值到对象MyClt中
  With MyClt
  .ClientName = MakeStr(txtorg)
  .ClientType = ComboType.ListIndex + 1
  .Contact = MakeStr(txtContact)
  .Address = MakeStr(txtAddr)
  .Postcode = MakeStr(txtCode)
  .Phone = MakeStr(txtPhone)
  .Fax = MakeStr(txtFax)
  .Describe = MakeStr(txtDescribe)
  '判断客户名称是否存在
  If Modify = False Or OriName <> Trim(txtorg) Then
    If .In_DB(MakeStr(txtorg)) = True Then
      MsgBox "客户单位已经存在,请重新输入"
      txtorg.SetFocus
      txtorg.SelStart = 0
      txtorg.SelLength = Len(txtorg)
      Exit Sub
    End If
  End If
  '根据变量Modify决定是插入新记录,还是修改记录
  '调用Update()函数的参数OriId表示当前编辑的客户编号
  If Modify = False Then
    .Insert
  Else
    .Update (OriId)
  End If
  End With
  '关闭窗体
  Unload Me
End Sub

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

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

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

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

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

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

Private Sub txtCode_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
  If In_Int(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

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

⌨️ 快捷键说明

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