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

📄 frmcontactedit.frm

📁 vb做的数据库 客户管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form FrmContactEdit 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑客户联系人信息"
   ClientHeight    =   3495
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6420
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3495
   ScaleWidth      =   6420
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Cmd_Cancel 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   400
      Left            =   3480
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   2940
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   400
      Left            =   1515
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   2940
      Width           =   1300
   End
   Begin VB.Frame Frame1 
      Height          =   2715
      Left            =   120
      TabIndex        =   6
      Top             =   120
      Width           =   6255
      Begin MSAdodcLib.Adodc AdoTitle 
         Height          =   375
         Left            =   3600
         Top             =   120
         Visible         =   0   'False
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   661
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   8
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   ""
         OLEDBString     =   ""
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "AdoTitle"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin MSDataListLib.DataCombo dc_Title 
         Height          =   330
         Left            =   4440
         TabIndex        =   13
         Top             =   600
         Width           =   1455
         _ExtentX        =   2566
         _ExtentY        =   582
         _Version        =   393216
         Style           =   2
         Text            =   ""
      End
      Begin VB.TextBox txtMemo 
         Height          =   870
         Left            =   1320
         MaxLength       =   20
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   3
         Top             =   1710
         Width           =   4575
      End
      Begin VB.TextBox txtName 
         Height          =   270
         Left            =   1320
         MaxLength       =   50
         TabIndex        =   1
         Top             =   635
         Width           =   1455
      End
      Begin VB.ComboBox ComboSex 
         Height          =   300
         Left            =   1320
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   1060
         Width           =   1455
      End
      Begin VB.TextBox txtOffice 
         Height          =   270
         Left            =   4440
         MaxLength       =   50
         TabIndex        =   0
         Top             =   1035
         Width           =   1455
      End
      Begin VB.Label Label14 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "单位电话"
         Height          =   180
         Left            =   3360
         TabIndex        =   14
         Top             =   1080
         Width           =   720
      End
      Begin VB.Label Lbl_CustName 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "客户名称"
         Height          =   180
         Left            =   1320
         TabIndex        =   12
         Top             =   240
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "其他信息"
         Height          =   180
         Left            =   360
         TabIndex        =   11
         Top             =   1740
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "所在职务"
         Height          =   180
         Left            =   3360
         TabIndex        =   10
         Top             =   680
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "联系人姓名"
         Height          =   180
         Left            =   180
         TabIndex        =   9
         Top             =   680
         Width           =   900
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "客户单位"
         Height          =   180
         Left            =   360
         TabIndex        =   8
         Top             =   240
         Width           =   720
      End
      Begin VB.Label Label16 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "联系人性别"
         Height          =   180
         Left            =   180
         TabIndex        =   7
         Top             =   1120
         Width           =   900
      End
   End
End
Attribute VB_Name = "FrmContactEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriCtId As Integer
Public OriCustId As Integer

Private Sub Cmd_OK_Click()
  '判断联系人输入信息是否完整
  If Trim(txtName) = "" Then
    MsgBox "请输入联系人姓名"
    txtName.SetFocus
    txtName.SelStart = 0
    txtName.SelLength = Len(Trim(txtName))
    Exit Sub
  End If
'  If Len(Trim(dc_Title.Text)) = 0 Then
'    MsgBox "请输入联系人职务"
'    dc_Title.SetFocus
'  End If
  '判断联系人是否已经存在
  If Modify = False Then
    If MyContact.In_DB(OriCustId, Trim(txtName)) = True Then
      MsgBox "客户“" + Trim(lbl_CustName) + ":" + Trim(txtName) + "”已经存在,请重新输入"
      txtName.SetFocus
      txtName.SelStart = 0
      txtName.SelLength = Len(txtName)
      Exit Sub
    End If
  End If
  '保存到数据库
  With MyContact
    .CustId = OriCustId
    .CName = Trim(txtName)
    .Sex = Trim(ComboSex.Text)
    .TitleId = Val(dc_Title.BoundText)
    .Office = Trim(txtOffice)
'    .Mobile = Trim(txtMobile)
'    .Birth = Trim(txtBirth)
'    .Hobby = Trim(txtHobby)
    .Memo = Trim(txtMemo)
  
    If Modify = False Then
      .Insert
    Else
      Call .Update(OriCtId)
    End If
  End With
  Unload Me
End Sub

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

Private Sub Form_Load()
  '装入联系人职务
  AdoTitle.ConnectionString = Conn
  AdoTitle.RecordSource = "SELECT * FROM Types WHERE Flag=3"
  AdoTitle.Refresh
  Set dc_Title.RowSource = AdoTitle
  dc_Title.ListField = "TypeName"
  dc_Title.BoundColumn = "Id"
  
  ComboSex.AddItem "男", 0
  ComboSex.AddItem "女", 1
End Sub

⌨️ 快捷键说明

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