Automatic pop up form/message

Sam Summers

Registered User.
Local time
Today, 14:22
Joined
Sep 17, 2001
Messages
939
This is probably not too difficult but I cant seem to find it so far -
Is there a way of making a message or form pop up on the screen if records that are due to expire within a month are in a table ?
For example if an employees certificate is due to expire in say 60 days?

Thanks everybody
 
In code on the current event of the form:

if myfield<DateAdd("d",-60,Date) then

MsgBox "This is expiring"

End if
 
Yes Sam,

There Is Way To Do That, You Have To Do That On Timer Of Any Opening Form, And Run A SQL To Look At You Table For The Need Condithion, If Yes Then Do Let Say Beep Open A Form ...... Etc.
If That Is Far For You, Please Feel Free To Clear More For Me Or Send ME Your DB Ore The Way You Can Eplain To ME And I'll Try To Help.

Good Luck
 
Thanks for that but this will flag a message if the form is opened, but how or can I generate a message based purely on records held in a table.
Cause I already have a set of forms that bring up expiring records based on queries but I was trying to be even cleverer by bringing up a message when the users opened the Database (If they wanted it to?)
 
Dim db As Database
Dim rs As Recordset
Dim qdf As QueryDef
Dim strSQL As String

Set db = CurrentDb
strSQL = "SELECT tbTable.[Pay No], tbTable.dtdue FROM tbTable WHERE (((tbTable.dtdue)=Date()+60));"
Set qdf = db.CreateQueryDef("", strSQL)
Set rs = qdf.OpenRecordset(dbOpenSnapshot)
If rs.EOF Or rs.BOF Then _
DoCmd.OpenForm "YourPopupMessage"
 
Sam,

If you want to check the expirey dates when the database is opened, create a macro called "autoexec", which runs code like that which llkhoutx provided.

Dave
 

Users who are viewing this thread

Back
Top Bottom