Dlookup problem

hmho

Registered User.
Local time
Yesterday, 17:58
Joined
Apr 7, 2009
Messages
93
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
 
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") & "#" )
 

Users who are viewing this thread

Back
Top Bottom