how do i create a calendar in access, where i can input dates?

G

Guest

I'm trying to create a calendar so that I can have a box where associates can
input their leave dates and it will appear on a calendar? is this possible?
 
B

Ben

Hi Heather,

When you say you want to create a calendar I assume you mean something like
an Outlook style view?

This is not easy in Access and I've never found a "perfect" solution - there
are various ActiveX components you can download but I've implemented a
solution using multiple instances of the same subforms keyed on date fields
on the parent from. For example for a "weekly" view, you would have seven
instances of the subform, displaying continuous records from the calendar
table - let's call them sub1...7. You then have corresponding date fields
on the main form - we'll call these subDate1...7. Each subform has it's
link parent field set to it's associated date field, and child field to the
underlying calendar date field.

As the user navigates (using command buttons on the main form) you
programatically cascade the date fields on the main form. So for example,
you have a master date field on the main form - called dateWeekCommencing.
You have a button to advance by a week - which updates dateWeekCommencing by
7 days (using dateAdd), and a button to go to the previous week in a similar
way. Your code then "cascades" this update to the subDate1..7 fields - a
simple loop through all 7 fields using dateAdd to advance by one day each
iteration. Lo and behold your subform instances show the calendared
activities for each of the seven days, a la Outlook. Looks like a calendar,
feels like a calender.

Now the bitter bit - this is easy to accomplish but would probably be
regarded as "bad practice" by those in the know. Multiple instances of
subforms are a bit kludgy, and although this works well with seven days,
slower machines or machines on slow networked databases may collapse if you
tried the same thing for a month! (That said I have made this work with
decent modern machines)

However, the only other option would be to use an ActiveX control - often a
real pain in Access. This is a pure Access based solution, and it DOES
work. You can bolt on a lot of extra functionality too - double-clicking on
a subform to enter a new event for example. I even managed to get dragging
and dropping to work after a fashion, by monitoring the mousedown event on
the subform!

If the above is too messy to follow, and you are interested in this
solution, I could always post a sample implementation to some webspace
somewhere for you to download and play with!

Best regards,

Ben.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top