Calender (1 Viewer)

kamphuuzz

Registered User.
Local time
Today, 05:38
Joined
Mar 17, 2015
Messages
11
[SOLVED] Calender

Hello,

I have found a calender databse witch I wanna use in one of my own databases.
But.. on the form the weeks start on sunday, I want the week to start on Monday but I can't figure out how to do it. I hope you guys can help me.
My VBA skills are basic, but still learning ;)

I've posted the original database as an attatchment. I'd like to know what I have to change in the code and/or in the form to get what i want.
 

Attachments

  • Wide Calendar with Switchboard.mdb
    788 KB · Views: 221
Last edited:

Rx_

Nothing In Moderation
Local time
Yesterday, 21:38
Joined
Oct 22, 2009
Messages
2,803
Please check the dates to make sure they match.
I only had a couple of minutes, but this seems to work.

Be sure to add appointments, modify them and check that the dates fall on the right day of the week. I didn't have much time to test it.

:cool:

If it doesn't work, please, please post so nobody else assumes it does.
If it does work, please report back and mark the thread as SOLVED

PLEASE NOTE - a problem was found - see later posting for the download that was updated and tested - Don't use this posted version - Please scroll down
 

Attachments

  • Wide Calendar with Switchboard.mdb
    732 KB · Views: 168
Last edited:

kamphuuzz

Registered User.
Local time
Today, 05:38
Joined
Mar 17, 2015
Messages
11
It's not completely working.
I changed the line:
Code:
strFirstOfMonth = "1/" & Str(intMonth) & Str(intYear)
back to:
Code:
strFirstOfMonth = Str(intMonth) & "/1/" & Str(intYear)
to make the date matches the right day.

But this only works for the month March. When ik go to april, it'll set the 1st of april on the monday.
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 04:38
Joined
Sep 21, 2011
Messages
14,393
I had a go last night and could not do it. I *thought* I had the solution this morning when I woke up, but there is stsill code to be changed.

The problem appears to be that you want Sunday (weekday 1) to be in the 7th column. Whilst I believe I have the blocks before and after now correct, I am getting overflow when trying to populate the calendar.

For all the effort involved, other than learning something new, I'd have left it as it was. :banghead:
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:38
Joined
Sep 21, 2011
Messages
14,393
I *think* I might have cracked it.

Not exhaustively tested, but dates, positions and blocks look good. Adding an appointment also seems to go in the correct block

Over to you to test. :D
 

Attachments

  • Wide Calendar with Switchboard.mdb
    792 KB · Views: 208

kamphuuzz

Registered User.
Local time
Today, 05:38
Joined
Mar 17, 2015
Messages
11
Did a couple of tests but couldn't find anything go wrong.
It really looks like you've cracked it.

Thank you very much Gasman!!
 

kamphuuzz

Registered User.
Local time
Today, 05:38
Joined
Mar 17, 2015
Messages
11
I've copied the changes to my own database, did a couple of test and it looks perfect! I say the problem is solved.

Thank you very, very much!!
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:38
Joined
Sep 21, 2011
Messages
14,393
Good, that means my day started off well. :D

You will see my comments if you want to see what was required. Only PopulateCalendar was changed. I must say that it was all a neat bit of code and showed a few things I did not know about.
 
  • Like
Reactions: Rx_

Rx_

Nothing In Moderation
Local time
Yesterday, 21:38
Joined
Oct 22, 2009
Messages
2,803
Let me suggest adding an About Me button, also update some of the comments at places you visited for the date formulas.
Then submit it to the Sample Database
http://www.access-programmers.co.uk/forums/forumdisplay.php?f=64
This was an interesting method of creating a block of days and assigning them with dates. It would probably help many others looking for an idea, solutions, or design concept.
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:38
Joined
Sep 21, 2011
Messages
14,393
I *think* I already have an About Me tab. Is that the same thing.?

I will add some extra comments and add to the reference forum as you suggest.

Thank you.
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:38
Joined
Sep 21, 2011
Messages
14,393
Having seen several threads that mention one is able to specify the start day of the week, I believe this request can be carried out more easily by changing just one line

Code:
bytFirstWeekdayOfMonth = WeekDay(strFirstOfMonth)
to
Code:
bytFirstWeekdayOfMonth = WeekDay(strFirstOfMonth, vbMonday)

and changing the labels on the form from Sun -Sat to Mon - Sun.

Only did some quick tests, but seems to work.

Ah well, you live and learn. :D
 

Rx_

Nothing In Moderation
Local time
Yesterday, 21:38
Joined
Oct 22, 2009
Messages
2,803
DOH! :eek:
Good catch! Thanks for sharing.
 

Users who are viewing this thread

Top Bottom