A
Alvin
I have the following code I got from a sample database that works great with
1 exception.
If I set a reminder for 6/25/05 and open the database on that date the
reminder will pop up, But
if I don't open the database on that date and open it 2 or 3 days later it
won't pop up. How can I code it so it will open any past reminders so they
can be deleted?
Here is the code I have.
------------- begin----------------------------------
Private Sub Form_Close()
' Opens the Reminders form in dialog mode if there
' are any entries in the tickler table
On Error GoTo HandleErr
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
strSQL = "select * from Tickler where TicklerDate <= Date " _
& "And TicklerDate=Date() And TicklerText Is Not Null " _
& "And Not TicklerText=''"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot, dbForwardOnly)
If rs.RecordCount > 0 Then
DoCmd.OpenForm "Reminders", , , "TicklerDate = Date()",
acFormReadOnly, acDialog
End If
ExitHere:
On Error Resume Next
rs.Close
Exit Sub
HandleErr:
Select Case Err
End Select
Resume ExitHere
End Sub
-----------------End----------------------------
1 exception.
If I set a reminder for 6/25/05 and open the database on that date the
reminder will pop up, But
if I don't open the database on that date and open it 2 or 3 days later it
won't pop up. How can I code it so it will open any past reminders so they
can be deleted?
Here is the code I have.
------------- begin----------------------------------
Private Sub Form_Close()
' Opens the Reminders form in dialog mode if there
' are any entries in the tickler table
On Error GoTo HandleErr
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
strSQL = "select * from Tickler where TicklerDate <= Date " _
& "And TicklerDate=Date() And TicklerText Is Not Null " _
& "And Not TicklerText=''"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot, dbForwardOnly)
If rs.RecordCount > 0 Then
DoCmd.OpenForm "Reminders", , , "TicklerDate = Date()",
acFormReadOnly, acDialog
End If
ExitHere:
On Error Resume Next
rs.Close
Exit Sub
HandleErr:
Select Case Err
End Select
Resume ExitHere
End Sub
-----------------End----------------------------