Display Last Import Date/Time in Text Box

gopherking

Registered User.
Local time
Yesterday, 22:12
Joined
May 26, 2011
Messages
31
I have an Import Audit Trail setup in my DB to capture any errors or successes when an import is performed. I would like for my main dashboard (form) to show in a text box the date/time that is stored for the last successful import. I am assuming that I need to use a DLookup function, but since I am looking for the most recent one, I'm a little confused on how to set it up within the Control Source for the text box. Below is my table and the fields within it:

Table Name: AuditImport

Fields:

ImportID - AutoNum field
Updated - Date/Time field
UserID - Text field
Status - Text field

So, from the above, I would like to display the most current Updated field information where the Status is like "Successful Import". Any help would be appreciated!
 
Sounds like you want a DMax(), not DLookup(), with your criteria.
 
Thanks pbaldy! The book that I was referencing didn't mention that you can use Criteria with the DMax (or most other Domain Functions for that matter), so I was thinking you could only specify the Field and Table to pull back the Max. I was able to put in the following to make it work (just in case anyone else needs to see what I did):

=DMax("[Updated]","AuditImport","[Status] = 'Successful Import'")
 

Users who are viewing this thread

Back
Top Bottom