Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2018, 01:16 AM
p45cal's Avatar
p45cal p45cal is offline Variable for Date not working Windows 10 Variable for Date not working 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
  #2  
Old 04-04-2018, 04:21 AM
Divinedar Divinedar is offline Variable for Date not working Windows 7 64bit Variable for Date not working Office 2010 64bit
Novice
Variable for Date not working
 
Join Date: Jun 2016
Posts: 21
Divinedar is on a distinguished road
Default Variable for Date not working

Ok I attached a workbook. I also made the variable global and it still didn't work. I had to zip the file. Waiting on your responses. thank you so much.
Attached Files
File Type: zip Example Workbook Fiscal Year.zip (750.6 KB, 12 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to create a bar chart of multiple variable. Then I need to draw trend lin of those variable shimulsiddiquee Excel 1 05-16-2017 07:39 AM
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
Variable for Date not working Run-time error 91 object variable or with block variable not set JUST ME Word VBA 4 03-25-2014 06:56 AM
Variable for Date not working Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM
30+ days Variable Day Date Calculations via Fields ztag Word 2 01-06-2012 11:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft