Update Current Row based on Previous Row

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AAVF

    #1

    Update Current Row based on Previous Row

    I have a small table that need to keep a balance of work outstanding. The
    fields are as follows

    REC_COUNT (auto-index created record counter)
    DATE (work date)
    QTY_REQD (work added on that date)
    BAL (balance of work outstanding at the end of that date)

    The field REC_COUNT is used as a sort order field so that there is no
    confusion about which record is next.

    I need to be able to read the BAL from the previous record and add to it the
    the QTY_REQD. I have tried using a query (I am not a VB programmer) using
    'Dlookup' where the REC_COUNT is the current REC_COUNT-1 but cannot get this
    to work. I have tested the theory of the DLookup OK by returning the
    REC_COUNT from the previous record. I assume this works as the REC_COUNT
    already exists for all records. However, the BAL field is null until this
    query runs.

    Can anyone throw any light on how I can achieve this with a query?

    Regards

    Tom


  • Tony Toews

    #2
    Re: Update Current Row based on Previous Row

    "AAVF" <tmillington@aa vf.co.uk> wrote:

    Please ignore the posting from the "starwars" persona. That person has some
    problems.

    Crossposting to several relevant newsgroups, such as you have, is perfectly fine.

    Tony
    --
    Tony Toews, Microsoft Access MVP
    Please respond only in the newsgroups so that others can
    read the entire thread of messages.
    Microsoft Access Links, Hints, Tips & Accounting Systems at

    Comment

    Working...