Last Record

  • Thread starter Thread starter Don Rountree
  • Start date Start date
D

Don Rountree

I use Access 2000. I have a form with a date field, beginning gallons field
and ending gallons field. Is there a way to have the ending gallons field,
automatically fill in the beginning gallons field the next day. Any help
would be appreciated.

Don Rountree
 
can there be more than one record entered for any given date? if so, how do
you tell which record was entered first on a specific date, which record was
entered second, etc?
 
Hi Don

The latest date in your table is returned by this query:
Select Max([DateField]) from [YourTable]

So, you can select the lastest *record* using this as a subquery in your
WHERE condition:
[DateField]=(Select Max([DateField]) from [YourTable])

Now, to get the [EndingGallons] out of that record, simply use DLookup:
DLookup( "[EndingGallons]", "[YourTable]",
"[DateField]=(Select Max([DateField]) from [YourTable])" )

If you set the DefaultValue of [BeginningGallons] in your form to this
DLookup expression, all should be taken care of.
 
Don, you will have to check all your repeat posts to find
a possible solution.

Please don't use a multi-post without some sort of
reference to an earlier post, especially so close together
as you have as others may want to follow a discussion
thread even if you don't.

Jonathan
 
Back
Top