Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does access have calendar ability?? 1

Status
Not open for further replies.

pmo

Technical User
Jan 15, 2001
76
AU
I want to be able to set up a calendar that allows me to click on a date and provide or retrieve information. A bit like a diary. Does access have any ability to display a calendar and allow links to it?
 

Not Really, you could design something to accomplish that, but your reinventing the wheel. Use Microsoft Outlook for calendaring entries.

Jason
 
Sure, it can be done, though it depends how well you know VBA / Access etc to whether you want to attempt it or not, becasue it can be done quite easily, though he more you get into it, the more coding it takes to control the process fully.

This is one way to do it, which is fairly simple and not too time consuming, though it is not a perfect solution.

1. Create a Table which has dates and activities, activity types, names, times, people etc etc (whatever you want in your calender entry.

2. Create a form and place the ActiveX Calendar Control onto it from Insert / ActiveX control on the menus. Rename this to something meaningful for ease of reference later - e.g: calMyCalender.

3. Now add the table to the record source and design your form so that the entries appear in continuous forms.. HINT: if I were you I would use a subform here.. that way it will look a lot better and you will be able to add more functionality later..

4. Now you need to use VB to add code behind the Calendar object which filters your subform using the date used within the calendar.

5. Adding an entry: a)Now add a button on your form which opens a new form to be populated by the user which creates an entry in the table and refreshes the original form.
OR b) allow the user to add directly into the subform.

The result is a basic calendar type form which shows you the days entries for the day selected in the calendar control. Of course, if there are no entries then the calendar won't show anything but a new record entry.. which you can disable if you want.. it's up to you.

If you want to add more functionality, you can switch the subform with a different subform at runtime if the user selects to see, for example, a week instead of a day this could then show a different styled form, OR you could simply change the filter to add 7 days to the selected date and use a range..

There are many ways to do this in this one example alone.. it depends on your requirements.. I have put an example bit of basic code below for assigning the dates etc..


'set calendar controls date.. (possibly when you open the form)
Code:
        me.calMyCalendar.Value = Date

'or to get the value and set the subform, something in the order of:
Code:
        Forms![frmMaster].sfmChild.form.filter = "[dteMyEntryDate]=#" & me.calMycalendar.value & "#"
'or you could issue SQL statements etc:
Code:
strSQL = _
"SELECT * FROM tblCalendarEntries " & _ 
"WHERE (((dteMyDateEntry)=#" & me.calMyCalendar.value & "#));"
'and then set as the subforms recordsource:
Code:
Forms![frmMaster].sfmChild.form.recordsource = strSQL

But please remember that this is only a basic setup to get you started, if you are looking to this to compliment a current application then the above is probably useful, however, if the sole purpose is to act as a calendar, then I would have to agree with Jason.. Outlook does it so much better !

Either way, best of luck.

Damian

damber@damber.net

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Better yet go to:


The included sample is great and does exactly what you want and shows you how to do other things as well. I have used this in my own code. NOte that the calendar is a standard form so you can change its look and feel as well. Note quite as slick as the true calendar control but you can do so much more with it.

Good luck.
 
Uncle Bill has done this for you.
Use the ActiveX Calander provided in MSAccess
I use a Definitions module to put all of my Global declaration. In that module add.
'****************** CONTROLS
Global ctl As Control

In a textbox on a form. (Click Event)

Private Sub StartDate_Click()
Set ctl = Screen.ActiveControl
DoCmd.OpenForm "frmCalendar"
End Sub

Create a form and call it frmCalander.
From design view insert the ActiveX "Calander"
Private Sub ActiveXCtl0_Updated(Code As Integer)
'MsgBox Me!ActiveXCtl0.Value
ctl = Me!ActiveXCtl0.Value
DoCmd.Close acForm, Me.Name
End Sub

Private Sub Form_Load()
Me!ActiveXCtl0.today
End Sub

Hope it helps. I use it extensively throught my databases. Let me know if you need any additional pointers.
 
Evitsnosliw,
thanks for your advice. Can you explain this without the use of code. I have no knowledge of this but have a reasonable understanding of what access has to offer.
I have now been able to locate the activeX calendar. I would like a relevant form to open when I click a particular day. Can you assist with this.

Wayne
wcmac@maxspeed.net.au
 
I will try.
1- Make your database window visible (press F11 if window not visible).
2- Select the Modules, select "New".
3- add '****************** CONTROLS
Global ctl As Control
4- Save as "DefinitionModule
5- On whatever form you want to insert the date add (if you do not have one) a textbox and name it "??Date"
6- Go to design mode on the form with "??Date". Make sure the Properties are exposed. On the line that says Click Event, click the down arrow and select Event Procedure. There will be three dots on the right hand margin. Click those 3 dots and your code will open. Type in;
Private Sub ??Date_Click() 'This line will be there
Set ctl = Screen.ActiveControl 'tyoe this
DoCmd.OpenForm "frmCalendar" 'type this
End Sub 'this will be there
' means this in a non-executing line
7- Create a form and call it frmCalander.
From design view insert the ActiveX "Calander"
8- In the On Load Event create an Event Procedure.

Private Sub ActiveXCtl0_Updated

ctl = Me!ActiveXCtl0.Value
DoCmd.Close acForm, Me.Name
End Sub

Private Sub Form_Load()
Me!ActiveXCtl0.today
End Sub
This should get your Calender open and closed after selecting the date.
At this point damber and I are basically repeating each other. You will have to decide how you want to manage the use of this date.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top