Just a quick note ...
DatePart("w", Now()-1)
Does NOT return the week number of the year, it returns the day integer for the day of the week
So ...
DatePart("w", #11/10/2008#-1) --> DatePart("w", #11/09/2008#) = 1 (which is typically Sunday)
But do take note that the system settings have an effect on the value returned, you see there is a 3rd argument to the DatePart() function which is used to indicate what you want to be called the first day of the week, which MOST systems that is set to Sunday, however ...
DatePart("w", #11/10/2008#-1, vbMonday) --> DatePart("w", #11/09/2008#, vbMonday) = 7 ... which means if Monday was day 1, then Sunday is day 7 ...
Many of the date functions have this argument, so be careful as the expression proposed by raskew (namely the Weekday() function) has the "first day of week argument" as well.
....
Ok ... with that established and going back to the original Question, let break down the expression ...
With Now() returning today, which is 11/10/2008 10:46 AM we have:
DateDiff("d", DatePart("w", Now()-1), Now() )
----
Get the day number of yesterday with ...
DatePart("w", Now()-1)
--> DatePart("w", #11/10/2008 10:46 AM#-1)
--> DatePart("w", #11/09/2008 10:46 AM#) = 1 (Sunday, assuming Sunday is day 1)
It is important to note, at this point, that Dates to Access and VBA are simply the number of days passed a base date. That base date in VBA and Access is 12/30/1899 12:00 AM. So in the next step, the expression in question OFFSETS the base date by the day number that was acheived in the first step of the expression. So the expression asked how many days are between 1 (12/31/1899) and Now (11/10/2008) ... which will be one day shy of how many days are between 0 (12/31/1899) and Now (11/10/2008)
DateDiff("d", 1, #11/10/2008 10:46 AM#) = 39761 days
Now, remember to Access/VBA, a date is a number, specifically the number of days passed the base date, so the serial number of 39761 (which is our final result) is 39761 days passed the base date, which is translated to a date of 11/09/2008 ...
You can get that value in a couple of ways ...
CDate(39761) = 11/09/2008
..Or..
DateAdd("d",39761,0) = 11/09/2008
....
So ... that is how the original expression gets the first day of the current week, it just offsets the base date by the day number of yesterday ... pretty creative really. But do note, that to get a specific day of the week, like what was last Friday ... you would indicate that Friday is the "first day of the week" and your expression would become ...
DateDiff("d", DatePart("w", Now()-1,vbFriday), Now(),vbFriday)
Which with today being 11/10/2008, will yeild 11/07/2008, once the raw number of days is converted to a date.
But becareful with this too ... because if we plug in a date that is a Friday, it will return LAST Friday's date ...
CDate(DateDiff("d", DatePart("w", #11/14/2008#-1,vbFriday), #11/14/2008#,vbFriday)) = 11/07/2008
...
{Note: all date formats in this post are US format mm/dd/yyyy}