Automatic pop up form/message (1 Viewer)

Sam Summers

Registered User.
Local time
Today, 06:27
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
 

dynamictiger

Registered User.
Local time
Today, 06:27
Joined
Feb 3, 2002
Messages
270
In code on the current event of the form:

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

MsgBox "This is expiring"

End if
 

Haitham

Registered User.
Local time
Today, 08:27
Joined
Oct 27, 2002
Messages
17
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
 

Sam Summers

Registered User.
Local time
Today, 06:27
Joined
Sep 17, 2001
Messages
939
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?)
 

llkhoutx

Registered User.
Local time
Today, 00:27
Joined
Feb 26, 2001
Messages
4,018
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"
 

dgm

Registered User.
Local time
Today, 15:27
Joined
Sep 5, 2002
Messages
146
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

Top Bottom