Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weekly Alert

Status
Not open for further replies.

dulla

Technical User
Feb 3, 2003
54
How do i get a weekly alert to display with a reminder in it? thanks.

ameen
 
Create a Table called Alert

FieldName Type
LastAlert Date
AlertMsg Text 255 Characters

If you have a form that loads all of the time in your application, place the following in the Load event:

Dim LastDate as Date
Dim Alert as String

LastDate = Dlookup("[LastAlert]","Alert")
Alert = Dlookup("[AlertMsg]","Alert")

If (Date() - LastDate) > 7 then
MsgBox Alert
DoCmd.SetWarnings False
Docmd.RunSql "Update [Alert] SET [LastAlert] = Date() ;"
DoCmd.SetWarnings True
End If

If (today's date - last alert date) is greater than 7 days, then the message will pop up when the form is opened.

Then today's date is sent to the Alert table to be used the next time the form loads.

Hope this helps.



Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top