How to see the last date entry on a form

G

Guest

Hi,
To make it short I will give you 3 major fields from my database.
Field1: Todays date (Automatic)
Field2: We entered the date the sales was done. (Manualy)
Field3: the Sales or data itself
Field......20
Problem:
Everytime I open the form, I need to know the date the last entry was made
and also the date of the last sales to make sure we dont enter the same data
twice.
In this format maybe:
"Last entry was done Friday 06 2006 for tthe sales Wednesday 04 2006". and
maybe if possible, the name of the field we entered the data like" in field
15".

My Field 1 and 2 have the date I need but I dont know who to get the last
date from them.
I think a textbox will do but I dont know the formula to get the lastdate in
a field.
Thank you for your help.
 
G

Guest

You can use the DMax function. Set the control Source of your textbox to:
=DMax("DateField", "YourTable")
 
K

kingston via AccessMonster.com

Assuming the last date is the most current one in Field1, it is the value
DMax("[Field1]","[TableName]").

The corresponding sales date is DMax("[Field2]","[TableName]","[Field1]=#" &
DMax("[Field1]","[TableName]") & "#")

You could get the last piece of the answer by writing procdures to track
changes, but I'm hoping that someone who knows more about the internal
workings of Access will have a better answer. I don't think that this can be
accomplished by using the Access System Objects.
 

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