永发信息网

谁有完整的通讯录代码?

答案:1  悬赏:40  手机版
解决时间 2021-05-05 12:30
谁有完整的通讯录代码?
最佳答案



Public panduan As Integer
Private Sub Combo1_Click()
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst "姓名='" & Combo1.Text & "'"
Call xianshi
End Sub


Private Sub Combo2_Click()
Data2.Recordset.MoveLast
Data2.Recordset.FindLast "时间='" & Combo2.Text & "'"
Call xianshi2
End Sub


Private Sub Command1_Click()
If Data1.Recordset.AbsolutePosition = Data1.Recordset.RecordCount - 1 Then
MsgBox "已经到最后一条记录", 0 + 16, "警告"
Exit Sub
Else
Data1.Recordset.MoveNext
Combo1.Text = Data1.Recordset("姓名")
Call xianshi
End If
End Sub


Private Sub Command10_Click()
If Command10.Caption = "写日记" Then
Text11.Text = ""
Combo2.Text = Text12.Text
Command10.Caption = "保存"
Else

With Data2
.Recordset.AddNew


.Recordset("时间") = Text12
.Recordset("事件") = Text11
.Recordset.Update
End With
Combo2.Clear
Data2.Refresh
Call chushihua2
Call xianshi2
Command10.Caption = "写日记"
End If
End Sub


Private Sub Command11_Click()
a = MsgBox("当前记录将被删除,确定吗?", 4 + 48, "警告")
If a = vbNo Then Exit Sub
Data2.Recordset.Delete
Data2.Refresh
Combo2.Clear
Call chushihua2
End Sub


Private Sub Command12_Click()
Data2.Recordset.MoveLast
Combo2.Text = Data2.Recordset("时间")
Call xianshi2
End Sub


Private Sub Command13_Click()
If Data2.Recordset.AbsolutePosition = 0 Then
MsgBox "这已经是最为古老的日记了", 0 + 16, ""
Exit Sub
Else
Data2.Recordset.MovePrevious
Combo2.Text = Data2.Recordset("时间")
Call xianshi2
End If
End Sub


Private Sub Command14_Click()
If Data2.Recordset.AbsolutePosition = Data2.Recordset.RecordCount - 1 Then
MsgBox "这已经是最新的一篇了", 0 + 16, "警告"
Exit Sub
Else
Data2.Recordset.MoveNext
Combo2.Text = Data2.Recordset("时间")
Call xianshi2
End If
End Sub


Private Sub Command2_Click()
panduan = 1
If Command2.Caption = "添加" Then
Command1.Enabled = False
Command3.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Command8.Enabled = False
Command9.Enabled = False
Command2.Caption = "保存数据"
Text2.Visible = True
Text3.Visible = True
Text4.Visible = True
Text5.Visible = True
Text6.Visible = True
Text7.Visible = True
Text8.Visible = True
Text9.Visible = True
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""


Else
If Text8.Text = "" Then
MsgBox "请输入完整数据!", 48, "警告"
Text8.SetFocus



Else
a = MsgBox("当前记录将被添加,确定吗?", 4 + 48, "警告")
If a = vbNo Then
Command2.Caption = "添加"
Command1.Enabled = True
Command3.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Text2.Visible = False
Text3.Visible = False
Text4.Visible = False
Text5.Visible = False
Text6.Visible = False
Text7.Visible = False
Text8.Visible = False
Text9.Visible = False
Exit Sub


Else
Command2.Caption = "添加"
Command1.Enabled = True
Command3.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Data1.Recordset.Edit
With Data1
.Recordset.AddNew
.Recordset("姓名") = Text8.Text
.Recordset("手机号") = Text2
.Recordset("性别") = Text3
.Recordset("工作单位") = Text4
.Recordset("职务") = Text5
.Recordset("电子邮箱") = Text6
.Recordset("联系地址") = Text7
.Recordset("QQ") = Text9
End With
Command2.Caption = "添加"
Text2.Visible = False
Text3.Visible = False
Text4.Visible = False
Text5.Visible = False
Text6.Visible = False
Text7.Visible = False
Text8.Visible = False
Text9.Visible = False
Combo1.Clear
Data1.Refresh
Call chushihua
Call xianshi
End If
End If
End If
End Sub


Private Sub Command3_Click()
If Command3.Caption = "修改" Then
Command1.Enabled = False
Command2.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Command8.Enabled = False
Command9.Enabled = False
Command3.Caption = "保存修改"
Text2.Visible = True
Text3.Visible = True
Text4.Visible = True
Text5.Visible = True
Text6.Visible = True
Text7.Visible = True
Text8.Visible = True
Text9.Visible = True


Text2.Text = Label12.Caption
Text3.Text = Label13.Caption
Text4.Text = Label14.Caption
Text5.Text = Label15.Caption
Text6.Text = Label16.Caption
Text7.Text = Label17.Caption
Text8.Text = Combo1.Text
Text9.Text = Label18.Caption
Else
If Text8.Text = "" Then
MsgBox "请输入完整数据!", 48
Text8.SetFocus


Else
a = MsgBox("当前记录将被修改,确定吗?", 4 + 48, "警告")
If a = vbNo Then
Command3.Caption = "修改"
Command1.Enabled = True
Command2.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Text2.Visible = False
Text3.Visible = False
Text4.Visible = False
Text5.Visible = False
Text6.Visible = False
Text7.Visible = False
Text8.Visible = False
Text9.Visible = False
Exit Sub
Else
Command3.Caption = "修改"
Command1.Enabled = True
Command2.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Data1.Recordset.Edit
With Data1
.Recordset("姓名") = Text8.Text
.Recordset("手机号") = Text2
.Recordset("性别") = Text3
.Recordset("工作单位") = Text4
.Recordset("职务") = Text5
.Recordset("电子邮箱") = Text6
.Recordset("联系地址") = Text7
.Recordset("QQ") = Text9
End With
Command3.Caption = "修改"
Text2.Visible = False
Text3.Visible = False
Text4.Visible = False
Text5.Visible = False
Text6.Visible = False
Text7.Visible = False
Text8.Visible = False
Text9.Visible = False
Combo1.Clear
Data1.Refresh
Call chushihua
Call xianshi
End If
End If
End If
End Sub


Private Sub Command4_Click()
If Command3.Caption = "保存修改" Or Command2.Caption = "保存数据" Then
Command3.Caption = "修改"
Command2.Caption = "添加"
Text2.Visible = False
Text3.Visible = False
Text4.Visible = False
Text5.Visible = False
Text6.Visible = False
Text7.Visible = False
Text8.Visible = False
Text9.Visible = False
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Combo1.Clear
Data1.Refresh
Call chushihua
Call xianshi
Else


End
End If
End Sub


Private Sub Command5_Click()
a = MsgBox("当前记录将被删除,确定吗?", 4 + 48, "警告")
If a = vbNo Then Exit Sub
Data1.Recordset.Delete
Data1.Refresh
Combo1.Clear
Call chushihua
End Sub



Private Sub Command6_Click()
If Data1.Recordset.AbsolutePosition = 0 Then
MsgBox "已经到达第一条了", 0 + 16, ""
Exit Sub
Else
Data1.Recordset.MovePrevious
Combo1.Text = Data1.Recordset("姓名")
Call xianshi
End If
End Sub


Private Sub Command7_Click()
Data1.Recordset.MoveFirst
Combo1.Text = Data1.Recordset("姓名")
Call xianshi
End Sub


Private Sub Command8_Click()
Data1.Recordset.MoveLast
Combo1.Text = Data1.Recordset("姓名")
Call xianshi
End Sub


Private Sub Command9_Click()
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst "手机号='" & Text10.Text & "'"
Combo1.Text = Data1.Recordset("姓名")
If Data1.Recordset.NoMatch Then
MsgBox "查无此人!", 48, "注意"
Else


Call xianshi
End If
Call xianshi
End Sub


Private Sub Form_Initialize()
Data1.Refresh
Data2.Refresh
Call chushihua
Call chushihua2
End Sub
Sub gengxin()
Data1.Recordset.MoveFirst
Data1.Recordset.Update
Data1.Recordset.Edit
End Sub
Sub chushihua()
Data1.Recordset.MoveFirst


Do While Data1.Recordset.EOF = False
Combo1.AddItem Data1.Recordset("姓名")


Data1.Recordset.MoveNext
Loop
jlzs = Data1.Recordset.RecordCount
Text1.Text = jlzs
Data1.Recordset.MoveFirst
Combo1.Text = Data1.Recordset("姓名")


Call xianshi
End Sub


Private Sub Form_Load()
Data1.DatabaseName = "db1.mdb"
Data2.DatabaseName = "db2.mdb"
Data1.RecordSource = "表2"
Data2.RecordSource = "表1"
Dim jlzs As Integer


End Sub
Private Sub Combo1_keyup(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst "姓名='" & Combo1.Text & "'"
Combo1.Text = Data1.Recordset("姓名")
If Data1.Recordset.NoMatch Then
MsgBox "查无此人!", 48, "注意"
Else


Call xianshi
End If
End If
End Sub


Sub xianshi()


Label8.Caption = "当前记录号:" & Data1.Recordset.AbsolutePosition + 1
End Sub
Sub xianshi2()
Text11 = Data2.Recordset("事件")
End Sub


Sub chushihua2()
Data2.Recordset.MoveFirst


Do While Data2.Recordset.EOF = False
Combo2.AddItem Data2.Recordset("时间")
Text11 = Data2.Recordset("事件")
Data2.Recordset.MoveNext
Loop


Data2.Recordset.MoveFirst
Combo2.Text = Data2.Recordset("时间")
Text11 = Data2.Recordset("事件")
Call xianshi
End Sub



Private Sub Text10_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst "手机号='" & Text10.Text & "'"
Combo1.Text = Data1.Recordset("姓名")
If Data1.Recordset.NoMatch Then
MsgBox "查无此人!", 48, "注意"
Else


Call xianshi
End If
End If
End Sub



Private Sub Timer1_Timer()
If Label19.Left + Label19.Width > 0 Then
Label19.Move Label19.Left - 20
Else
Label19.Left = Form1.ScaleWidth
End If
End Sub


Private Sub Timer2_Timer()
Text12.Text = Now
End Sub
sadas

我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
CF从上尉2升到一个金星耀多少经验
怎么开通网上银行帮支付宝充值
斑竹园中学地址有知道的么?有点事想过去
为什么有台风
长沙的天气为什么这么善变?
SQL Server 数据库优化怎么做?
好记星V3高中英语人教版必修1、2课件下载
对局中如何向玩家发送表情
哲学家维特根斯坦说:我贴在地面步行,不在云
永寿县金良工贸有限公司地址在什么地方,想过
关于 谷歌地球
2010未知错误
女生的请进来回答下。。。
请问如果紫钻到期了,那买永久紫钻的物品还在
我的DNF开不了,TP安全启动还没完,就提示错
推荐资讯
无聊的时候干嘛.?
iphone十分钟之前还好好的,发了条短信,放在
怎么冲QQ年会员??
怎样把从百度搜来的图片上传到QQ空间的相册上
苏州到黄埭的82路公交怎么变路线了?现在的路
关于雷锋塔的名句,游西湖雷锋塔诗词有多少
谁帮我开通“游戏人生”啊!谢谢啊!Q号:144
玩QQ飞车用什么键盘好
孕妇如何恢复身材
我手机型号是天语B926可以下载手机主题吗?怎
求查看加密空间日志的方法
N81手机主题怎么下载
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?