Create a pop-up window for expired...

J

Jeannie

This is for a permit database. I made a query that will bring up all the
expired permits. The permits expire anywhere from 10-50 years, and so it's
not something that needs checking regularly, so I'd like to have access bring
up a pop-up when the file is opened that tells when one of these permits has
expired. Is this possible?
 
L

Larry Daugherty

Yes, it can be done. How it should be done and the required
interaction with the user is up to you to decide and implement.

FWIW: Given that your permits remain valid for many years I would
only run the query once each year (or month or week) and save the date
of the last run. You could explicitly run it any time.

HTH
 
J

John Nurick

Hi Jeannie,

Perhaps the simplest way is along these lines:

1) create a report, based on your query, that displays the information
you want on expired permits and whatever instructions the user needs.
Let's call it rptExpiredPermitAlert

2) in the report's OnNoData event procedure, just put
Cancel = True

3) If the database already has an AutoExec macro, add an OpenReport
action to open rptExpiredPermitAlert in print preview mode.

Otherwise, create a macro, add the OpenReport action as above and save
the macro, naming it AutoExec.

When the database opens, it will attempt to open the report, which
will run the query. But if the query doesn't return any records (no
expired permits) the OnNoData event will occur and the report won't
open.

Alternatively if you need to open a form (e.g. so you can put controls
for the user to act on the expired permits), the general idea is

If DCount("*", "qryExpiredPermits") > 0 Then
'there are expired permits
DoCmd.OpenForm frmExpiredPermitAlert
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top