📄 frm_通讯录.frm
字号:
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "姓名:"
ForeColor = &H8000000E&
Height = 255
Index = 1
Left = 0
TabIndex = 34
Top = 390
Width = 1035
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "性别:"
ForeColor = &H8000000E&
Height = 255
Index = 2
Left = 3540
TabIndex = 33
Top = 405
Width = 975
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "所在部门:"
ForeColor = &H8000000E&
Height = 255
Index = 3
Left = 0
TabIndex = 32
Top = 780
Width = 945
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "职务:"
ForeColor = &H8000000E&
Height = 255
Index = 4
Left = 3540
TabIndex = 31
Top = 735
Width = 945
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "公司名称:"
ForeColor = &H8000000E&
Height = 255
Index = 5
Left = 0
TabIndex = 30
Top = 2640
Width = 945
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "家庭地址:"
ForeColor = &H8000000E&
Height = 255
Index = 6
Left = 60
TabIndex = 29
Top = 4140
Width = 945
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "办公电话:"
ForeColor = &H8000000E&
Height = 255
Index = 7
Left = 0
TabIndex = 28
Top = 1140
Width = 975
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "手机:"
ForeColor = &H8000000E&
Height = 255
Index = 8
Left = 0
TabIndex = 27
Top = 1500
Width = 885
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "备注:"
ForeColor = &H8000000E&
Height = 255
Index = 9
Left = 60
TabIndex = 26
Top = 4800
Width = 1815
End
End
Begin VB.CommandButton Command3
BackColor = &H00FFC0C0&
Caption = "关于"
Height = 375
Left = 7500
Style = 1 'Graphical
TabIndex = 20
Top = 2160
Width = 975
End
Begin VB.ComboBox CobFind
Height = 300
Left = 7380
Style = 2 'Dropdown List
TabIndex = 22
Top = 3240
Width = 1095
End
Begin VB.TextBox TexFind
Height = 375
Left = 7380
TabIndex = 23
Top = 3600
Width = 1095
End
Begin VB.CommandButton ComFind
BackColor = &H00FFC0C0&
Caption = "查询"
Height = 375
Left = 7500
Style = 1 'Graphical
TabIndex = 21
Top = 2640
Width = 975
End
Begin VB.CommandButton cmdClose
BackColor = &H00FFC0C0&
Caption = "关闭(&C)"
Height = 300
Left = 7500
Style = 1 'Graphical
TabIndex = 24
Top = 4080
Width = 975
End
Begin VB.CommandButton cmdUpdate
BackColor = &H00FFC0C0&
Caption = "修改(&E)"
Height = 300
Left = 7500
Style = 1 'Graphical
TabIndex = 19
Top = 1680
Width = 975
End
Begin VB.CommandButton cmdRefresh
BackColor = &H00FFC0C0&
Caption = "保存(&S)"
Height = 300
Left = 7500
Style = 1 'Graphical
TabIndex = 18
Top = 1200
Width = 975
End
Begin VB.CommandButton cmdDelete
BackColor = &H00FFC0C0&
Caption = "删除(&D)"
Height = 300
Left = 7500
MaskColor = &H00FFC0C0&
Style = 1 'Graphical
TabIndex = 17
Top = 720
Width = 975
End
Begin VB.CommandButton cmdAdd
BackColor = &H00FFC0C0&
Caption = "添加(&A)"
Height = 300
Left = 7500
MaskColor = &H00FFC0C0&
Style = 1 'Graphical
TabIndex = 16
Top = 240
Width = 975
End
Begin VB.Data Data1
Align = 2 'Align Bottom
Caption = "通讯录"
Connect = "Access"
DatabaseName = "H:\企业管理\程序\data\通讯录.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 360
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "通讯录"
Top = 5880
Width = 8925
End
Begin VB.Image Image1
Height = 780
Left = 7680
Picture = "Frm_通讯录.frx":08CA
Stretch = -1 'True
Top = 4740
Width = 855
End
End
Attribute VB_Name = "Frm_通讯录"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdAdd_Click()
Me.Data1.Recordset.AddNew
Me.Data1.Recordset.Update
Data1.Recordset.MoveLast
Frame1.Enabled = True
txtFields(1).SetFocus
End Sub
Private Sub cmdDelete_Click()
'如果删除记录集的最后一条记录
'记录或记录集中唯一的记录
If Me.Data1.Recordset.RecordCount > 0 And Not Me.Data1.Recordset.EOF And Not Me.Data1.Recordset.BOF Then
HXFYN = MsgBox("是否删除?", 36, "信息提示")
If HXFYN = vbYes Then
Me.Data1.Recordset.Delete
Me.Data1.Recordset.MoveNext
If Me.Data1.Recordset.EOF And Me.Data1.Recordset.RecordCount > 0 Then
Me.Data1.Recordset.MovePrevious
End If
End If
End If
End Sub
Private Sub cmdRefresh_Click()
Data1.UpdateRecord
Frame1.Enabled = False
End Sub
Private Sub cmdUpdate_Click()
Frame1.Enabled = True
txtFields(1).SetFocus
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub ComFind_Click()
If TexFind.Text = "" Then
MsgBox "请输入查询内容!", 48, "提示"
Exit Sub
End If
If CobFind.Text = "姓名" Then
Data1.Recordset.FindFirst "姓名=" & "'" & TexFind.Text & "'"
ElseIf CobFind.Text = "公司名称" Then
Data1.Recordset.FindFirst "公司名称=" & "'" & TexFind.Text & "'"
End If
If Data1.Recordset.NoMatch Then
MsgBox "记录不存在", 64, "提示"
End If
End Sub
Private Sub Command3_Click()
Dim l As String
l = Space(2) & "通讯录" & vbCrLf & Space(4) & "作者:窦晓平" & vbCrLf & "南京兆基电器有限公司"
MsgBox l, vbOKOnly + vbInformation, "通讯录"
End Sub
Private Sub Form_Load()
CobFind.AddItem "姓名"
CobFind.AddItem "公司名称"
CobFind.Text = "姓名"
Combo1.AddItem "男"
Combo1.AddItem "女"
Me.Data1.DatabaseName = App.Path + "\data\通讯录.mdb"
Me.Data1.RecordSource = "select * from 通讯录"
Me.Data1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -