Default value from Previous Record

Carnafex

Registered User.
Local time
Today, 19:36
Joined
Jan 19, 2004
Messages
38
Just 2 quick questions.

Firstly:
I have been asked by my employer to make the default value of a text box on a new record the value from a previous record.
In this case, I use continuous forms as the display, and the records record an employee's leave.
So the form runs like this; on the left is the total days of leave left, then some details are in the middle (not important for this) and then on the right is the total days used and the remaining days of leave.
For example:

10 days of leave left ; he takes 2 days, then 8 days remain.

Now at this point, I need it that when a new record is added, the default value for days of leave left will be equal to the previous records days remaining. I know how to do this by creating a recordset in VB code, but Im looking to see if there are any more efficent ways to do this (my database is quite large and so I have to keep it optimised for speed). Any ideas would be great.

And Secondly;
This a simple but annoying thing that happened to me. I recently upgraded from Access 97 to 2k (no XP for me, we are trying to keep everyone on the same version :rolleyes: ) and now some of my help files are missing.
Ordinary help files are there, but any DAO help (for example, OpenRecordSet) simply either says "Error in help file" or brings up a blank help screen.

I checked the install and it seems okay, (I even reinstalled to see if it would fix it), but nothing seems to help.
Could I have missed something? Any help (no pun intended) would be appreciated.

Ta
Jason
 
SELECT tblLeave.EmployeeID, tblLeave.DaysGiven, tblLeave.DaysOnLeave, [tblLeave.DaysGiven]-[tblLeave.DaysOnLeave] AS DaysLeft
FROM tblLeave
WHERE (((tblLeave.EmployeeID) Like [EmployeeID]));

Something like that could work, you would just have to adapt it. OR the best way (for tracking purposes) would be a start date minus an end date, then count the days in between, then subtract from the number for days their given.
________
LAMBORGHINI REVENT?N HISTORY
 
Last edited:
Thanks for the reply. Ill go and give tham a shot.
Ta
Jason
 

Users who are viewing this thread

Back
Top Bottom