Results 1 to 8 of 8
  1. #1
    marimar1097 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    4

    Post Return value of row above

    Hello,
    I am trying to create an IIF statement where i can get the value of the previous row if the value Is Null.

    In other words if the field is blank, fill in the value of what is above it.


    PLN0077907 12
    PLN0077908 (BLANK) Need this to be 12
    PLN0077909 13
    PLN0077910 14



    Thanks in advance.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The previous record may be displayed above the current one but it is not easy to reach like in a spreadsheet. Unless a DLookup will work for you, the only other way I know is to use a Recordset and walk through it with .MoveNext.

  3. #3
    marimar1097 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    4
    Thank you for taking the time to reply. I guess i will just stick to using Excel.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is this for a form or a report? There are other options available in a report.

  5. #5
    marimar1097 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    4
    Can the end product be exported to an ascii text file?

    Here is my problem from the beginning.

    1. I have a list of single page images that are listed in a sequential order.
    2. The "parent" of the images is always identified with a "D' in the data.
    Example:
    IM,PLN0077945,D,0,PLN0077942-0001.TIF;2
    IM,PLN0077946, ,0,PLN0077942-0002.TIF;2
    IM,PLN0077947, ,0,PLN0077942-0003.TIF;2
    IM,PLN0077948, ,0,PLN0077942-0004.TIF;2
    IM,PLN0077949, ,0,PLN0077942-0005.TIF;2
    IM,PLN0077950, ,0,PLN0077942-0006.TIF;2
    IM,PLN0077951,D,0,PLN0077943-0001.TIF;2
    IM,PLN0077952,D,0,PLN0077944-0001.TIF;2
    IM,PLN0077953,D,0,PLN0077945-0001.TIF;2
    IM,PLN0077954,D,0,PLN0077946-0001.TIF;2
    IM,PLN0077955,D,0,PLN0077947-0001.TIF;2
    IM,PLN0077956, ,0,PLN0077947-0002.TIF;2
    IM,PLN0077957, ,0,PLN0077947-0003.TIF;2
    IM,PLN0077958, ,0,PLN0077947-0004.TIF;2
    IM,PLN0077959, ,0,PLN0077947-0005.TIF;2

    3. A Family starts at the first D and continues until the next "D".
    4. I need to recreate the same type of file but remove certain "families".
    5. I have a separate list that will indicate which parents need to stay.

    The thought behind my original question was that i could group all the families by marking the parent image with a numeric ID and then create some sort of formula that would give the rest of the family the same id. I could then do a match query based on the Family ID and strip away the unwanted items.

    I usually do this in Excel but i was trying to see if i could accomplish the same goal in Access.

    -Marimar

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It looks like each record already has a unique number you could use in the 2nd PLN number.

  7. #7
    marimar1097 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    4
    oh yes sorry. Usually that number is the same as the first identifier.

    IM,PLN0077945,D,0,PLN0077945.TIF;2
    IM,PLN0077946, ,0,PLN0077946.TIF;2
    IM,PLN0077947, ,0,PLN0077947.TIF;2
    IM,PLN0077948, ,0,PLN0077948.TIF;2
    IM,PLN0077949, ,0,PLN0077949.TIF;2
    IM,PLN0077950, ,0,PLN0077950.TIF;2
    IM,PLN0077951,D,0,PLN0077951.TIF;2
    IM,PLN0077952,D,0,PLN0077952.TIF;2
    IM,PLN0077953,D,0,PLN0077953.TIF;2
    IM,PLN0077954,D,0,PLN0077954.TIF;2
    IM,PLN0077955,D,0,PLN0077955.TIF;2
    IM,PLN0077956, ,0,PLN0077956.TIF;2
    IM,PLN0077957, ,0,PLN0077957.TIF;2
    IM,PLN0077958, ,0,PLN0077958.TIF;2
    IM,PLN0077959, ,0,PLN0077959.TIF;2

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    OK. You could develop code that would give each "set" of records a unique number by walking through a Recordset with .MoveNext.

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

Similar Threads

  1. Return all values from two queries
    By matteu1 in forum Queries
    Replies: 0
    Last Post: 08-18-2009, 01:02 PM
  2. Replies: 0
    Last Post: 08-04-2009, 08:51 PM
  3. return last updated date for each product
    By jonnyuk3 in forum Queries
    Replies: 0
    Last Post: 06-17-2009, 04:38 AM
  4. I need to return a value for calculation.
    By FestoAccessBuilder in forum Access
    Replies: 1
    Last Post: 02-22-2009, 09:58 AM
  5. Return Record # In Query
    By redwinger354 in forum Access
    Replies: 1
    Last Post: 09-15-2007, 01:08 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