📄 form52.frm
字号:
Begin VB.TextBox Text6
Height = 270
Left = 4110
TabIndex = 5
Text = "Text6"
Top = 1095
Width = 1950
End
Begin VB.Label Label16
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "性 别:"
Height = 180
Left = 3390
TabIndex = 37
Top = 1545
Width = 720
End
Begin VB.Label Label14
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "家庭电话:"
Height = 180
Left = 270
TabIndex = 36
Top = 1545
Width = 900
End
Begin VB.Label Label15
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "家庭地址:"
Height = 165
Left = 270
TabIndex = 35
Top = 1920
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "姓 名:"
Height = 180
Left = 285
TabIndex = 23
Top = 375
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "手机号码:"
Height = 180
Left = 270
TabIndex = 22
Top = 780
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "助记码:"
Height = 180
Left = 3390
TabIndex = 21
Top = 375
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "小灵通:"
Height = 180
Left = 3375
TabIndex = 20
Top = 765
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "电子信箱:"
Height = 180
Left = 255
TabIndex = 19
Top = 1125
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "QQ号码:"
Height = 180
Left = 3390
TabIndex = 18
Top = 1140
Width = 720
End
End
Begin VB.Label Label13
BackColor = &H00C0FFFF&
BorderStyle = 1 'Fixed Single
Height = 315
Left = 0
TabIndex = 34
Top = 5295
Visible = 0 'False
Width = 1140
End
End
Attribute VB_Name = "Form5"
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()
Load Form6
Form6.Show
Me.Enabled = False
End Sub
Private Sub Command2_Click()
If Len(Trim(Text12.Text)) > 700 Then
MsgBox "备注信息文字内容过长,请保持在700字范围之内。", vbInformation, "文字内容过长"
Exit Sub
End If
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 Len(Trim(Text3.Text)) < 11 And Trim(Text3.Text) <> "" Then
MsgBox "手机号码不得小于11位。", vbInformation, "手机号码长度不够"
Exit Sub
End If
If Trim(Text3.Text) <> "" Then
If Left(Trim(Text3.Text), 1) <> "1" Then
MsgBox "手机号码的第一个数字必须以1开头。", vbInformation, "手机号码错误"
Exit Sub
End If
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 rs.RecordCount = 1 And Trim(Text3.Text) <> "" Then
If rs!id = Val(Form5.Label13.Caption) Then
'判断出来是同一个联系人
Else
MsgBox "数据库中已经存在了这个手机号码,号码隶属于 " & rs!姓名 & " 所有,请确定正确的手机号码,软件不允许添加相同的手机号。", vbInformation, "重号"
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Exit Sub
End If
End If
rs.Close
Set rs = db.OpenRecordset("select * from ren where id=" & Val(Form5.Label13.Caption))
If rs.RecordCount = 0 Then
MsgBox "定位修改源的时候出现了错误,程序无法找到要修改的联系人。该操作执行失败。", vbInformation, "修改没有完成"
rs.Close
db.Close
Unload Me
Else
rs.Edit
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
MsgBox "修改联系人资料的操作已经执行完毕。", vbInformation, "完毕"
Me.Hide
If frmshowallrenshow = True Then
ShowAllRen (FrmShowAllRen.Label1.Caption)
End If
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End If
Unload Me
End Sub
Private Sub Command3_Click()
EditComInfo (Val(Text7.Text))
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 4
Me.Left = (Screen.Width - Me.Width) / 2
Me.Icon = MDIForm1.Icon
Me.BackColor = FormBackColor
Me.Frame1.BackColor = Me.BackColor
Me.Frame2.BackColor = Me.BackColor
Me.Frame3.BackColor = Me.BackColor
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 = ""
Me.Height = 6495
Me.Width = 6675
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 Text10_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text11_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text12_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text14_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text15_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text2_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text2_LostFocus()
Text2.Text = Trim(UCase(Text2.Text))
End Sub
Private Sub Text3_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text4_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text5_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text6_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text8_GotFocus()
SendKeys "{end}"
End Sub
Private Sub Text9_GotFocus()
SendKeys "{end}"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -