Avatar of darls15
darls15
 asked on

Access calendar database dates placed incorrectly

Hi Experts

I found a calendar/events database on the Internet which I would like to adapt and use. There's only one problem - the dates aren't appearing on the calendar correctly. For example, 17th March is showing as Monday and it should be Tuesday. Other calendars (April, May etc.) are also wrong. I have no idea how to fix this in the code and would appreciate any assistance in getting it right. And is there a way to stop it from constantly blinking at every second change?

Thanks
darls15
Calendar.accdb
Microsoft Access

Avatar of undefined
Last Comment
Hamed Nasr

8/22/2022 - Mon
Hamed Nasr

I ran the database and it gave a correct result for the date mentioned.
Labels are static starting Sunday.
darls15

ASKER
Hi,

I just ran it again to be sure and have attached a screenshot of how it displays for me. March 17 is shows under the Monday header and not Tuesday. April dates are also way out.

Do you have any further advice?

Thanks
darls15
CalendarScreenshot.PNG
Hamed Nasr

From the image you uploaded, I suspect the day labels as they are static. They are not used anywhere in the code.

Try to modify them to start from Monday, and report back.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Gustav Brock

This is just another example of sloppy code. Dates are sometimes string handled like here:

bytFirstWeekdayOfMonth = WeekDay(strFirstOfMonth)

And the weekday lables are hardcoded.
If you  move the Monday label to the first position and rearrange the others, it may work.

/gustav
darls15

ASKER
Hi

Thank you for getting back to me. I've tried your suggestions of moving the labels to the first position. This fixes the calendar for March, however when I move to April, the days and dates do not align. Please see attached screenshot.

I'm don't know how to alter the code to fix this and would appreciate any assistance.

Many thanks
darls15
darls15

ASKER
Sorry, the screenshot...
darls15
April.PNG
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Gustav Brock

Oh. The reason is that the code is very US centric, ignoring International standards. It could be recoded but that might be a major work.
I'm confident I could do it, but I don't have the time neither the need. Sorry.

/gustav
ASKER CERTIFIED SOLUTION
Hamed Nasr

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
darls15

ASKER
Thank you, I really appreciate your help with this.
Hamed Nasr

Welcome!
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23