Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access date 1

Status
Not open for further replies.

missippi

IS-IT--Management
Feb 8, 2001
42
US
Hi,

I have a form called hours that I would like the field date to display the last typed date after the update button has been pressed.

What happens is you enter hours, date, ID number and then you press the update hours button that puts the data into a table. I want the last date that was entered displayed in the Date text box when the form is returned new for the next entery.

Any ideas?

Marie
 
Marie,
Do you mean the 'highest date', or the 'last date entered'--ie, someone may have been the last one to enter some date, and that date was jun 1, 1945. This is of course much different than the highest date. For Highest date, use DMax(). For latest entered date, you'd need to have some sort of sequential Record ID or TimeStamp on the record, but I'd have to assume you do mean the highest date.
For dmax, the syntax is
HighestDate = Dmax("dateField","MyTable") 'Optionally adding criteria, ie:
HighestDate = Dmax("dateField","MyTable","ID = " & Forms!myForm!EmployeeID)
--Jim
 
Jim,

Thanks. I do mean the last date. Our time keeper has to put in many days at a time of information about time worked and it would be easier if he didnt have to type the date each time. I will try the highest date because that would work most of the time.

THank!~
 
Jim,

It worked and my time keeper will be thrilled!

Thanks Again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top