Results 1 to 5 of 5
  1. #1
    Derzou is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    2

    Adding a value from the preceding record


    I would like to add a value from the preceding record to a value in the current record.

    This is obviously easy in a speadsheet, but I just wonder how to do it easily in Access ...

    Thanks

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    Are you only looking to the previous record, or the entire set?

    How are you expecting the set to be ordered? Do the records have a date field?

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Not nearly as easy in Access since the concept of "preceding record" is quite relative. What value or field would identify the "preceding record"?

  4. #4
    Derzou is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2011
    Posts
    2
    Yes, the table is sorted by date.
    I solved the problem in using two queries.
    The first, with records sorted by date in descending order.
    And using a second query with a field such as
    [Montant]+DLookUp("[Valeur]";"rq T_Epargne";"[Date] <" & "#" & [Date] & "#")

    Not as easy as I hoped for, but it's working.

    Thanks !

    Derzou

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That is how it is done in Access or any RDBMS for that matter.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo Box values based on preceding selection
    By speckytwat in forum Access
    Replies: 11
    Last Post: 04-27-2011, 11:35 AM
  2. Adding new Record issue
    By yosik20 in forum Forms
    Replies: 3
    Last Post: 04-13-2011, 10:19 AM
  3. Adding a record not found in another table.
    By Buakaw in forum Queries
    Replies: 1
    Last Post: 03-03-2011, 05:38 AM
  4. Replies: 3
    Last Post: 10-28-2010, 07:02 AM
  5. Adding a single record
    By kfoyil in forum Forms
    Replies: 2
    Last Post: 11-22-2006, 09:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums