Last Contact Date (Auto Update value in field) (1 Viewer)

gfultz

Registered User.
Local time
Yesterday, 22:20
Joined
Dec 18, 2009
Messages
51
I have a database where I store notes in a separate table where it stamps the username and date and time of the note automatically. I know how to use SQL to select the latest date, but I want to know how to make the field automatically requery when a report is run. It is easy to do on the form, set the vb code to requery the field at specific events. My guess right now is to set the query to run when a new record is created in the notes table. I would just like to know if there is an easier way to be sure it is capturing the latest.

My SQL code looks like this:

SELECT Date FROM (PO INNER JOIN NOTES ON PO.MRID=NOTES.MRID) WHERE Date=(SELECT MAX(Date) FROM NOTES)

Any help is appreciated.
 

gfultz

Registered User.
Local time
Yesterday, 22:20
Joined
Dec 18, 2009
Messages
51
I just thought... Maybe the best way is to not store ths data in the table, but have a field pull the data in the query used for the reports. Is that the better way?
 

milehighfreak

Registered User.
Local time
Yesterday, 23:20
Joined
Dec 16, 2009
Messages
16
I just thought... Maybe the best way is to not store ths data in the table, but have a field pull the data in the query used for the reports. Is that the better way?

Far better. Base your report on a query and it will be forced to run and update every time you run the report.
 

Users who are viewing this thread

Top Bottom