Continuious Form Problem

  • Thread starter Thread starter DavidW
  • Start date Start date
D

DavidW

How do you get a textbox to equal the last matching record in continious
forms. I tried Dmax and its doing just that.
What I am trying to do is go back to the previous month and retrieve a field
called begin. Each record from month to month has the same identical field
of "veh" in the record list.
Thanks
David
 
I have got =(DLast("[emile]","[gasquery]")) for the controlsoucre of the
textbox on the continious form
and the query is sorted ascending by date. What I am getting is the last of
emile for one record only, it repeats itself all the way down, anotherwords
it take the last entry number(120) in the query and puts it in every record
instead of looking at what was entered for each individual record for the
previous month.
The recordsource for the form is the same ["gasquery"]
Any Ideals??
 
From your previous post, you may prefer putting this in for the Default
Value of the textbox. This will give you the value for a new record, but you
could change it to whatever you want. I suspect the textbox should actually
be a bound textbox, not a calculated one. Also, you probably need a Where
condition in the statement to limit you to the previous month's last entry.
Without it, as soon as you start making entries for this month, the new
entries will become the last entries.

=DLast("[emilie]","gasquery",Format([DateField],"mmyyyy") & "=" &
Format(DateAdd("m",-1,Date()),"mmyyyy"))

--
Wayne Morgan
Microsoft Access MVP


DavidW said:
I have got =(DLast("[emile]","[gasquery]")) for the controlsoucre of the
textbox on the continious form
and the query is sorted ascending by date. What I am getting is the last of
emile for one record only, it repeats itself all the way down, anotherwords
it take the last entry number(120) in the query and puts it in every record
instead of looking at what was entered for each individual record for the
previous month.
The recordsource for the form is the same ["gasquery"]
Any Ideals??
Have you tried DLast on a query with the records sorted by date?
 
Back
Top