Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Calculating on Previous Record Field

Calculating on Previous Record Field

Calculating on Previous Record Field

I have a report that groups a property with any leases it has had during a given period. How can I calculate the days the property was vacant based on a field in the previous record's lease vacating date and the next lease start date, i.e.:

Lease 1 Start Date / End Date /
Lease 2 Start Date / End Date / Days Vacant = [Start Date] - [Lease 1 End Date]
Lease 3 Start Date / Days Vacant = [Start Date] - [Lease 2 End Date]

There is no limit to the number of leases a property might have.

RE: Calculating on Previous Record Field

I would use a subquery in the report's record source query to get the previous dates.

Hook'D on Access
MS Access MVP

RE: Calculating on Previous Record Field

Thanks, I ended up dusting of my rusty MS Access code skills and wrote"on print" code that stored the value of the previous lease vacation date and calculated this with the current lease start date an passed the result into a custom field value in the report.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close