How to prevent #Error values derived from Nulls in an outer join
You need to apply the function (Nz) that replaces the null with another value before the week function call. Use:

week( Nz(Tab2.y, Value_for_y) , Nz(Tab2.w, Value_for_w) ) 


You probably also need tests against the special Value_for_y or Value_for_w inside week().