标题:[求助]求备忘录的源码
只看楼主
seguiwo
Rank: 1
等 级:新手上路
帖 子:76
专家分:0
注 册:2007-4-11
 问题点数:0 回复次数:3 
[求助]求备忘录的源码
我想做个备忘录
可是不能实现循环提醒的功能
我很是郁闷
有谁能帮我做个简单的备忘录,只要能实现周期提醒就可以了
我想参考参考
小弟感恩不禁
我先谢谢大家了
搜索更多相关主题的帖子: 备忘录 源码 周期 
2007-04-26 10:23
seguiwo
Rank: 1
等 级:新手上路
帖 子:76
专家分:0
注 册:2007-4-11
得分:0 

怎么没有人看啊
大家共同给个方法啊


2007-04-26 11:02
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
当程序运行时把数据库的日期和当前系统的日期对比就行了...

/images/2011/147787/2011051411021524.jpg" border="0" />
2007-04-26 11:16
seguiwo
Rank: 1
等 级:新手上路
帖 子:76
专家分:0
注 册:2007-4-11
得分:0 

Dim myado As New ADODB.Connection
Dim rs As New ADODB.Recordset


Private Sub add_Click()
add.Enabled = False
Text1.Text = ""
Text2.Text = Now
Text3.Text = ""
Text1.SetFocus
save.Enabled = True
del.Enabled = False
End Sub

Private Sub del_Click()
If Val(List2.List(List1.ListIndex)) <> 18 Then
rs.Find "ID=" & Val(List2.List(List1.ListIndex))
rs.Delete
rs.Update
rs.MoveFirst
list2init
save.Enabled = False
del.Enabled = False
End If
End Sub

Private Sub Form_Load()
myado.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "/adu.mdb;Persist Security Info=False"
myado.Open
rs.Open "select * from beizhu order by 备忘时间", myado, 1, 3
list2init
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
xunhuaninit
End Sub

Private Sub List1_Click()
rs.MoveFirst
rs.Find "ID=" & Val(List2.List(List1.ListIndex))
A = "ID=" & Val(List2.List(List1.ListIndex))
Text1.Text = rs.Fields("备忘时间")
If rs.Fields("备忘时间") < Now Then
Text1.ForeColor = &HFFFF&
Else
Text1.ForeColor = &HFF00FF
End If
Text2.Text = rs.Fields("操作时间")
Text3.Text = rs.Fields("备忘内容")
xunhuan = rs.Fields("周期")
If xunhuan = "0" Then
Option1.Value = True
End If
If xunhuan = "1" Then
Option2.Value = True
End If
If xunhuan = "2" Then
Option3.Value = True
End If
List1.ToolTipText = List1.Text
save.Enabled = True
del.Enabled = True
add.Enabled = True
End Sub

Private Sub save_Click()
If Text1.Text = "" Then
MsgBox "备忘时间不能为空!"
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "操作时间不能为空!"
Text2.SetFocus
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "备忘内容不能为空!"
Text3.SetFocus
Exit Sub
End If
If Option1.Value = True Then
xunhuan = "0"
End If
If Option2.Value = True Then
xunhuan = "1"
End If
If Option3.Value = True Then
xunhuan = "2"
End If
On Error GoTo A
If add.Enabled = False Then
rs.AddNew
rs.Fields("备忘时间") = Text1.Text
rs.Fields("操作时间") = Text2.Text
rs.Fields("备忘内容") = Text3.Text
rs.Fields("周期") = xunhuan
rs.Update
list2init
Else
rs.Find "ID=" & Val(List2.List(List1.ListIndex))
rs.Fields("备忘时间") = Text1.Text
rs.Fields("操作时间") = Text2.Text
rs.Fields("备忘内容") = Text3.Text
rs.Fields("周期") = xunhuan
rs.Update
list2init
End If
save.Enabled = False
del.Enabled = False
Exit Sub
A:
MsgBox "时间填写有误!"
End Sub

Public Sub list2init()
List1.Clear
List2.Clear
List3.Clear
rs.MoveFirst
Do While Not rs.EOF
List1.AddItem rs.Fields("备忘内容")
List2.AddItem rs.Fields("ID")
List3.AddItem rs.Fields("备忘时间")
rs.MoveNext
Loop
End Sub

Private Sub Timer1_Timer()
For i = 0 To List3.ListCount - 1
If List3.List(i) = Now Then
Me.SetFocus
Me.Caption = "你有备忘录了!请查看."
MsgBox "你好! 请看下面的备忘记录: " & Now & vbCrLf & List1.List(i)
xunhuaninit
list2init
Me.Caption = "备忘录"
End If
Next
label5 = Now
End Sub

Public Sub xunhuaninit()
rs.MoveFirst
Do While Not rs.EOF
If rs.Fields("周期") = "1" And rs.Fields("备忘时间") < Now Then
rs.Fields("备忘时间") = rs.Fields("备忘时间") + 1
End If
If rs.Fields("周期") = "2" And rs.Fields("备忘时间") < Now Then
rs.Fields("备忘时间") = rs.Fields("备忘时间") + 30
End If
rs.MoveNext
Loop
End Sub


2007-05-11 12:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-135062-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.164835 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved