How can I show if data exits somewhere else.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

allow me to explain this, I have a frontend to a database just for
teamleaders, I'd like to put in a label on the swithboard that will display
if there has been any records entered on another DB as they'll need to print
of reports based from that. That other BD is rarely used so this would save
them checking it everyday to see if there is stuff there to print off. So i
just want it to say something like "there are some reports to be printed" or
blank if non are there.

Thanks for any help.
 
Is this a front end to a common backend (i.e., did you use the database
splitter) or is this a completely separate database?
 
Paul,

I think you will have to manage this with actual data. This may involve
the addition of fields in the existing tables. There could be a number
of approaches to this. For example, you could have a DateCreated field
in the main data table, which automatically (via a Default Value of
Date()) records the date of a new record. And then, you could have a
simple table with one record and one field, which has a date, and this
date is updated whenever the reports are printed. So then, when the
application is opened, you could have a procedure that checks to see if
there are any records in the main table with a DateCreated later than
the ReportPrinted date in the tracking table, and if so, display the
label. The code could be done using Domain Aggregate functions, for
example...
Dim LastPrinted As Date
Dim NewRecords As Boolean
LastPrinted = DLookup("[ReportPrinted]","ReportTracker")
NewRecords = DCount("*","YourTable","[DateCreated]>#" & LastPrinted &
"#")>0
Me.ReportNotification.Visible = NewRecords
 
Back
Top