DLast Function(2)

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

My message of minutes ago, Subject: DLast function was a
bit misleading. I mentioned that my database consists of
records where each new record is the day after the
previous record. I don't want the date info in the
previous record's [DATE] field entered into the next
record's date field - I want the next date information
entered into the new record's [DATE] field. This should
involve a DLast Lookup of the previous record's [DATE]
field and some kind of expression. I did this in a
database numbering system almost like autonumber which
used DLast "VCR" number and added one to it for the next
(new) record's "VCR" number field. Again, this was some
years ago. The next date information is not necessarily
the current date's value (that one I know) since I don't
update every day. I notice that time is Pacific - it is
12:30p here in Florida.
 
Richard,

First of all, a hint... The word Date has a special meaning in Access,
and as such should not be used as the name of a field. Therefore, I
will change it to EntryDate.

On your form, set the Default Value of the EntryDate control to...
DMax("[EntryDate]","YourTable")+1
This will work if your form is a single view form. If it is a
continuous view form, you will need to do it differently. Make a
macro with a SetValue action:
Item: [EntryDate]
Expression: DMax("[EntryDate]","YourTable")+1
.... and assign this macro to the form's Before Insert event property.

- Steve Schapel, Microsoft Access MVP
 
Back
Top