View Single Post
 
Old 04-04-2018, 01:16 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2010 32bit
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

In the code which calls PrjByMonth, you're Dimming pMonth, then using it in the arguments without having assigned any value to it. Since it's Dimmed as a date its starting value is 0, or midnight on 1/1/1900(?).
[edit post posting: it seems if pMonth is assigned a value less than 1, only a time element is assigned to it.]
You need to assign something to pMonth before calling the function.

Even if you have a global variable pMonth, this version of pMonth will be local; if you want a global version of pMonth to be used, remove the Dim statement for it in ViewPrjByMth.

BTW, the same applies to strField.

Attaching a workbook would be good.
Reply With Quote