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

📄 form4.frm

📁 软件用到的技巧:透明窗体
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Left            =   1110
         TabIndex        =   25
         Text            =   "Text7"
         Top             =   210
         Width           =   645
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "所属企业:"
         Height          =   180
         Left            =   210
         TabIndex        =   24
         Top             =   270
         Width           =   900
      End
   End
   Begin VB.Frame Frame3 
      Height          =   2100
      Left            =   225
      TabIndex        =   26
      Top             =   3165
      Width           =   6210
      Begin VB.TextBox Text12 
         Height          =   885
         Left            =   1110
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   15
         Text            =   "Form4.frx":0053
         Top             =   1065
         Width           =   4980
      End
      Begin VB.TextBox Text11 
         Height          =   300
         Left            =   3915
         TabIndex        =   14
         Text            =   "Text11"
         Top             =   645
         Width           =   2175
      End
      Begin VB.TextBox Text10 
         Height          =   270
         Left            =   1110
         TabIndex        =   13
         Text            =   "Text10"
         Top             =   675
         Width           =   1620
      End
      Begin VB.TextBox Text9 
         Height          =   300
         Left            =   3915
         TabIndex        =   12
         Text            =   "Text9"
         Top             =   225
         Width           =   2160
      End
      Begin VB.TextBox Text8 
         Height          =   300
         Left            =   1110
         TabIndex        =   11
         Text            =   "Text8"
         Top             =   225
         Width           =   1620
      End
      Begin VB.Label Label12 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "其他说明:"
         Height          =   180
         Left            =   195
         TabIndex        =   31
         Top             =   1065
         Width           =   900
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "办公传真:"
         Height          =   180
         Left            =   3000
         TabIndex        =   30
         Top             =   705
         Width           =   900
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "办公电话:"
         Height          =   180
         Left            =   195
         TabIndex        =   29
         Top             =   705
         Width           =   900
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "职务:"
         Height          =   180
         Left            =   3360
         TabIndex        =   28
         Top             =   300
         Width           =   540
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "部门:"
         Height          =   180
         Left            =   570
         TabIndex        =   27
         Top             =   285
         Width           =   540
      End
   End
End
Attribute VB_Name = "FrmRenAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/12/24
'描    述:商务名片及客户资料管理系统 Ver 1.73
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Option Explicit

Private Sub Command1_Click()
On Error GoTo cli
    FrmRenAdd.Enabled = False
    Load Form4
    Form4.Show
    Exit Sub
cli:
End Sub

Private Sub Command2_Click()
    If Len(Trim(Text12.Text)) > 700 Then
        MsgBox "备注信息文字内容过长,请保持在700字范围之内。", vbInformation, "文字内容过长"
        Text12.SetFocus
        Exit Sub
    End If

    Dim db As Database
    Dim rs As Recordset
    Set db = OpenDatabase(MdbPath)
    Set rs = db.OpenRecordset("select * from ren where 手机号码='" & Trim(Text3.Text) & "'") '打开库
    
    If Trim(Text1.Text) = "" Then
        Text1.Text = Trim(Text1.Text)
        Text1.SetFocus
        Exit Sub
    End If
    If Trim(Text2.Text) = "" Then
        Text2.Text = Trim(Text2.Text)
        Text2.SetFocus
        Exit Sub
    End If ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''如果姓名或助记码为空
    If Trim(Text3.Text) = "" And Trim(Text4.Text) = "" And Trim(Text10.Text) = "" And Trim(Text11.Text) = "" And Trim(Text14.Text) = "" Then
        MsgBox "联系人的手机号码、小灵通号码、办公电话、传真号码、家庭电话等联系方式不得全部为空,否则将不得添加联系人。", vbInformation, "信息不全"
        Exit Sub
    End If ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''如果联系电话全部为空
    If Trim(Text3.Text) <> "" Then
        If Len(Trim(Text3.Text)) < 11 Then
            MsgBox "手机号码不得小于11位。", vbInformation, "手机号码长度不够"
            Exit Sub
        End If
        If Left(Trim(Text3.Text), 1) <> "1" Then
            MsgBox "手机号码的第一个数字必须以 [1] 开头。", vbInformation, "手机号码错误"
            Exit Sub
        End If
        If rs.RecordCount = 1 Then
            MsgBox "数据库中已经存在了这个手机号码,号码隶属于 " & rs!姓名 & " 所有,请确定正确的手机号码,软件不允许添加相同的号。", vbInformation, "重号"
            rs.Close
            db.Close
            Set rs = Nothing
            Set db = Nothing

            Exit Sub
        End If
    End If
   
    rs.AddNew
        rs!姓名 = Trim(Text1.Text)
        rs!助记码 = Trim(Text2.Text)
        rs!所属企业 = Val(Trim(Text7.Text))
        rs!手机号码 = Trim(Text3.Text)
        rs!小灵通 = Trim(Text4.Text)
        rs!部门 = Trim(Text8.Text)
        rs!职务 = Trim(Text9.Text)
        rs!办公电话 = Trim(Text10.Text)
        rs!办公传真 = Trim(Text11.Text)
        rs!QQ号码 = Trim(Text6.Text)
        rs!电子信箱 = Trim(Text5.Text)
        rs!其他说明 = Trim(Text12.Text)
        rs!性别 = Trim(Combo1.ListIndex)
        rs!家庭电话 = Trim(Text14.Text)
        rs!家庭地址 = Trim(Text15.Text)
    rs.Update
    'If form2show = True Then
    '    allshow (Form2.Label1.Caption)
    'End If
    If frmshowallrenshow = True Then
        ShowAllRen (FrmShowAllRen.Label1.Caption)
    End If
    MsgBox "添加联系人的操作已经执行完毕。", vbInformation, "添加"
    SumNumber
    Unload Me
    
        
End Sub

Private Sub Form_Load()
    Me.Top = (Screen.Height - Me.Height) / 4
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Icon = MDIForm1.Icon
    FrmRenAddShow = True
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    Text6.Text = ""
    Text7.Text = ""
    Text8.Text = ""
    Text9.Text = ""
    Text10.Text = ""
    Text11.Text = ""
    Text12.Text = ""
    Text13.Text = ""
    Text14.Text = ""
    Text15.Text = ""
    Combo1.ListIndex = 0
        Me.BackColor = FormBackColor: Me.Frame1.BackColor = Me.BackColor: Me.Frame2.BackColor = Me.BackColor: Me.Frame3.BackColor = Me.BackColor
End Sub

Private Sub Form_Unload(Cancel As Integer)
    FrmRenAddShow = False
End Sub

Private Sub Text1_Change()
    Text2.Text = UCase(AutoPY1.AutoPY(Trim(Text1.Text)))
End Sub

Private Sub Text1_GotFocus()
    SendKeys "{end}"

End Sub

Private Sub Text2_LostFocus()
Text2.Text = Trim(UCase(Text2.Text))
End Sub

⌨️ 快捷键说明

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