DLast Function(2)

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.
 
S

Steve Schapel

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
 

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