Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Forums > Developers
Back to Access Developer Forum    Comments List
1899 Year Issue Access 365 Upload Images   Link   Email  
Stewart Meikle       
2 months ago
Hello everyone

I hope I'm posting in the right place.
I purchased the Calendar course and I'm in Australia so that might be the reason I have this issue. So far I cannot get around it.

The code is for the DatePicker as per below

------------------------------------
Private Sub CalculateStartDate()

' Set the first day of current month
StartDate = DateSerial(Year(Calendar), Month(Calendar), 1)
------------------------------------

but this causes the date to return as 26/11/1899 etc

Only thing that comes close to making this work is by changing Calendar to Startdate!

' Set the first day of current month
StartDate = DateSerial(Year(StartDate), Month(StartDate), 1)

Which for some reason it works but it breaks the greying out days that are not part of the full month.

I have tried many different date formats including with seconds everywhere to no avail so after a couple days I need to seek help if any one can please. Thank you.

Kind Regards

Stewart.

Richard Rost            
2 months ago
I have no familiarity with international versions of Access, but is your date serial the same? Are the parameters in the same order?
Stewart Meikle       
2 months ago
Thanks for the quick response Richard. We use day / month / year format. I've also set my Windows 11 computer to the US setup and the same thing which is odd!
I've tried adjusting the order as well everywhere but not in the date serial code, I keep getting errors.
Any suggestions on that would be great.

Cheers

Stewart.
Stewart Meikle       
2 months ago
An Update.

I got it working with the below code but it still breaks the greying out days that are not part of the full month also the very start of the calendar is from the date I pick and not the 1st of the month. Oh also it thinks the 20th Feb is a Saturday so need to fix up those issues.

Cheers

Stewart.

----------------------
   Dim StartDate As Date
    
    Dim MyYear As Integer
    Dim MyMonth As Integer
    Dim MyDay As Integer
    
    StartDate = DateSerial(Year(Calendar), Month(Calendar), 1)
--------------------------------

Richard Rost            
2 months ago
That's weird. It's almost like its a type conversion error. StartDate is a field on the form right?
Stewart Meikle       
2 months ago
Yes, your MonthlyCalendarF form in fact :-)

To get the first of the month none of the below 4 options work! They all run without errors but now that the dates are being passed on as Integer to make the calendar work the rest fails lol.

StartDate = DateSerial(MyYear(Calendar), MyMonth(Calendar), 1)

StartDate = DateSerial(Year(Calendar), Month(Calendar), 1)

StartDate = DateSerial(Year(D), Month(D) - 1, 1)

StartDate = DateSerial(MyYear, MyMonth)

with using the code below that is at the very start.
Private Sub CalculateStartDate()

   Dim StartDate As Date
    
    Dim MyYear As Integer
    Dim MyMonth As Integer
    Dim MyDay As Integer
    



Stewart Meikle       
2 months ago
Just an Update.

For everything to work with the DatePicker I need to add a MsgBox as weird as this is but it works. No idea why and slightly annoying as I have to click on the MsgBox that comes up.

MsgBox StartDate = DateSerial(Year(Date), Month(Date) + 1, 1)


Cheers

Stewart.
Richard Rost            
2 months ago
That's a weird one.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/15/2024 8:17:36 AM. PLT: 0s
xxx