Results 1 to 3 of 3

Thread: Dlookup problem

  1. #1
    Join Date
    Apr 2009
    Posts
    67

    Unanswered: Dlookup problem

    I have form that I enter daily sales and I have field where I have dlookup to bring the previous day's data and here are the codes.
    Table name is [TblDailySales]
    Form name [FrmDailySales]
    =Dlookup("[Stick]","TblDailySales","[ReportDate]=[ReportDate]-1")
    The problem is sometimes I'm getting the previous day's Stick and most of the time not. can someone help me what I'm doing wrong.

    Thanks

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Paul

  3. #3
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    You need to have the date in the correct format similar to this

    =Dlookup("[Stick]","TblDailySales","[ReportDate]=#" & format([forms]![your form name]![ReportDate]-1,"mm/dd/yyyy") & "#" )

Posting Permissions

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