Results 1 to 4 of 4
  1. #1
    Kaloyanides is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Arlington, MA
    Posts
    51

    If Blank or Null Grab Previous Value

    I have a table full of products we've purchased.

    I want to assign a cost or value for each product for each day whether we purchased that day or not.

    Example From

    Product Purchase Date Cost
    ItemA 1/1/2019 $1.00
    ItemA 1/3/2019 $2.00


    ItemA 1/5/2019 $1.00

    Example To
    ItemA 1/1/2019 $1.00
    ItemA 1/2/2019 $1.00 (carried from prev. record)
    ItemA 1/3/2019 $2.00
    ItemA 1/4/2019 $2.00 (carried from prev. record)
    ItemA 1/5/2019 $1.00

    I've tried DLookup but this a bit over my head...

    Hopefully someone out there has an easy solution...

    Thanks!

  2. #2
    Kaloyanides is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Arlington, MA
    Posts
    51
    Trying this.... But not working......
    iif([itemcost]<>0,[itemcost],IIf(IsNull([itemcost]) and DLookUp("[itemcost]","TBLTEMPCOSTINGTABLE2","[ID]=[ID]-1")>0,DLookUp("[itemcost]","TBLTEMPCOSTINGTABLE2","[ID]=[ID]-1"),0))

  3. #3
    Gina Maylone is offline Always learning
    Windows 10 Access 2016
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    Try this: DLookup("yourfield","yourtable","RecordID = " & Me.RecordID -1)

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    You would need to use a cartesian join (product) to get all the dates from a Dates table -download the sample from this forum and adapt it to your need:https://www.accessforums.net/showthread.php?t=74995.

    Cheers,
    Vlad

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

Similar Threads

  1. Remove Blank Space if Null
    By laniebe in forum Reports
    Replies: 3
    Last Post: 04-27-2017, 01:01 AM
  2. Replies: 3
    Last Post: 11-13-2014, 12:37 PM
  3. Replies: 9
    Last Post: 03-16-2012, 01:03 PM
  4. Null field blank
    By brobb56 in forum Reports
    Replies: 3
    Last Post: 09-26-2011, 12:15 PM
  5. Add data from previous record if blank
    By mbc321 in forum Queries
    Replies: 1
    Last Post: 08-08-2009, 05:15 PM

Tags for this Thread

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