Sub setup_for_alert_popup()

    ' run this one time to set up the table,

    '   add your dates & messages as desired

    DoCmd.RunSQL "CREATE TABLE tblAlert (MyDate DATETIME, Done BIT, Message TEXT(50))"

    DoCmd.SetWarnings False

    DoCmd.RunSQL "INSERT INTO tblAlert (MyDate, Done, Message) VALUES (#4/29/2009#, False, 'Message for April 29')"

    DoCmd.RunSQL "INSERT INTO tblAlert (MyDate, Done, Message) VALUES (#5/1/2009#, False, 'Message for May 1')"

    DoCmd.SetWarnings True

End Sub

 

Function alert_popup()

    ' execute this from your AutoExec macro

    '   using Action = RunCode and Function = alert_popup()

    ' it will display the message the first time you open the application

    '   on the specified date

    Dim s As String

    s = "MyDate = #" & Date & "# AND Done = False"

    If DCount("*", "tblAlert", s) > 0 Then

        MsgBox DLookup("Message", "tblAlert", s)

        DoCmd.SetWarnings False

        DoCmd.RunSQL "UPDATE tblAlert SET Done = True WHERE " & s

        DoCmd.SetWarnings True

    End If

End Function