Access2000: Calculating in unbound textbox

A

Arvi Laanemets

Hi

Seemingly my head is somewhat dull today (because I have a cold maybe?), and
I can't find good solution.

I have a contionous form, where some data about usage of cars is registered.
The form is based on some table, let's it be tblUsage, with fields UsageID,
CarID, UsageDateTime, ..., Distance.

Then I have a table tblFix with fields FixID, CarID, FixDate, ...,
Spidometer0, where for every car is at least one row, and where some
parameters like car spidometer values for freely selected dates are stored -
it's assumed that the stored values correspond to 00:00:00 of this date.

I need on form an unbound textbox, where for every record, the spidometer
value for this date is calculated, based on latest Spidometer0 in tblFix for
this car and UsageDate (max fixdate for
tblUsage.UsageDateTime>=tblFix.FixDate And tblUsage.CarID=tblFix.CarID), as
sum of Spidometer0 and sum of distances from FixDate until UsageDateTime for
this car. As I need this in contionous form, I can't use saved queries. And
the calculated value must include latest changes in form's Distance textbox
too.

Is such calculation possible?
Thanks in advance for help!
Arvi Laanemets
 
T

Tom Wickerath

Hi Arvi,

You might want to try this sample out, which includes an example using
odometer readings. Perhaps it will be helpful in your situation:

Referring to a Field in the Previous Record or Next Record
http://support.microsoft.com/?id=210504


Tom
________________________________________

:

Hi

Seemingly my head is somewhat dull today (because I have a cold maybe?), and
I can't find good solution.

I have a contionous form, where some data about usage of cars is registered.
The form is based on some table, let's it be tblUsage, with fields UsageID,
CarID, UsageDateTime, ..., Distance.

Then I have a table tblFix with fields FixID, CarID, FixDate, ...,
Spidometer0, where for every car is at least one row, and where some
parameters like car spidometer values for freely selected dates are stored -
it's assumed that the stored values correspond to 00:00:00 of this date.

I need on form an unbound textbox, where for every record, the spidometer
value for this date is calculated, based on latest Spidometer0 in tblFix for
this car and UsageDate (max fixdate for
tblUsage.UsageDateTime>=tblFix.FixDate And tblUsage.CarID=tblFix.CarID), as
sum of Spidometer0 and sum of distances from FixDate until UsageDateTime for
this car. As I need this in contionous form, I can't use saved queries. And
the calculated value must include latest changes in form's Distance textbox
too.

Is such calculation possible?
Thanks in advance for help!
Arvi Laanemets
 

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