Last Record

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
 
T

tina

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?
 
G

Graham Mandeno

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

Jonathan Parminter

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
 

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