Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    May 2002
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculate values from fields in the previous row (Access 2000)

    I need to do the following in an Access form, using Visual Basic:

    Field 1 is the result of a calculation based on multiple fields in the previous row/record. Basically, how do we copy the value of a field from a previous row to a field in the current row?

    Any help is greatly appreciated.

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calculate values from fields in the previous row (Access 2000)

    See <post#=345613>post 345613</post#> for some links to MSKB articles about retrieving values from the previous record. See if you can use them. If you need more assistance, please provide more detailed information.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Calculate values from fields in the previous row (Access 2000)

    In addition to Hans' comments, I should point out that order in an Access form is not guaranteed. More often than not if you find yourself needing to refer to a field in another record in the same table, then there is a table design problem. There is an implicit order to data when you first enter data into a table, but subsequent compacts and edits of the table can likely alter it. In addition, if a user decides to sort the table by some field, the order will almost certainly change, and your calculated value will be for some other record. If you can divulge a few more details we may be able to suggest alternative designs that work around the issue - Access for example supports the concept of self-joins.
    Wendell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •