By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 1,646 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Calendar Control question

P: n/a
Is it possible to create a calendar that shows previous input data and
also allows for input of new data?
Nov 13 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
You would need to design this as a form to allow for adding new data..
Or else uyse a report for the previous input data and have a floating form
(pop-up) over the report to add new data....depending on how complicated the
info you are adding is this could work....

The form would allow for a 'click on a date box...add new info' approach.

HTH
Mal.
"Shyguy" <sh****@aol.com> wrote in message
news:1f********************************@4ax.com...
Is it possible to create a calendar that shows previous input data and
also allows for input of new data?

Nov 13 '05 #2

P: n/a
Hi,

Assuming that your Calendar *is* the default ActiveX one that ships with
Access...
and that the form that it is on is a bound form...
In this example the field that stores existing (or new) dates is named
"HoliDate".
The Calendar control is named "MyCalendar"

**********************************
Private Sub Form_Current()

Dim MyDate
MyDate = Me![Holidate]

Dim Msg As String
Msg = ""

Dim CR As String
CR = vbCrLf

If IsNull(MyDate) Then

Msg = Msg & "The current record does not contain a date ... " & CR & CR
Msg = Msg & "The current date will be inserted by default, " & CR
Msg = Msg & "but can be changed by selecting a date from the calendar."
MsgBox (Msg)
Me![MyCalendar].Value = Date
Me![Holidate] = Date

End If
End Sub

Private Sub MyCalendar_AfterUpdate()
'Yes, the AfterUpdate event can be used with an ActiveX calendar
'even though it is not included in the control's Property Sheet for reasons
unknown???

Me![Holidate] = Me![MyCalendar]
End Sub

**********************************

--
HTH,
Don
=============================
E-Mail (if you must)
My*****@Telus.net

Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.

================================

"Shyguy" <sh****@aol.com> wrote in message
news:1f********************************@4ax.com...
Is it possible to create a calendar that shows previous input data and
also allows for input of new data?

Nov 13 '05 #3

P: n/a
Thanks for the response. What I want to do is display a calendar on
the screen that would allow user to click in a days "box" and input
data. The "box" would also need to display any previously input data
when the calendar is opened. It would have to except 2 or 3 inputs
per date. I'm starting to think that this is not possible. ;-(
On Fri, 09 Jul 2004 02:16:24 GMT, "Don Leverton"
<le****************@telusplanet.net> wrote:
Hi,

Assuming that your Calendar *is* the default ActiveX one that ships with
Access...
and that the form that it is on is a bound form...
In this example the field that stores existing (or new) dates is named
"HoliDate".
The Calendar control is named "MyCalendar"

**********************************
Private Sub Form_Current()

Dim MyDate
MyDate = Me![Holidate]

Dim Msg As String
Msg = ""

Dim CR As String
CR = vbCrLf

If IsNull(MyDate) Then

Msg = Msg & "The current record does not contain a date ... " & CR & CR
Msg = Msg & "The current date will be inserted by default, " & CR
Msg = Msg & "but can be changed by selecting a date from the calendar."
MsgBox (Msg)
Me![MyCalendar].Value = Date
Me![Holidate] = Date

End If
End Sub

Private Sub MyCalendar_AfterUpdate()
'Yes, the AfterUpdate event can be used with an ActiveX calendar
'even though it is not included in the control's Property Sheet for reasons
unknown???

Me![Holidate] = Me![MyCalendar]
End Sub

**********************************


Nov 13 '05 #4

P: n/a
Shyguy <sh****@aol.com> wrote in message news:<36********************************@4ax.com>. ..
Thanks for the response. What I want to do is display a calendar on
the screen that would allow user to click in a days "box" and input
data. The "box" would also need to display any previously input data
when the calendar is opened. It would have to except 2 or 3 inputs
per date. I'm starting to think that this is not possible. ;-(

If you're trying to create something like an Outlook appointment
calendar, maybe this would work...

Use the calendar form from the Developer Handbook, and write the
selected date to a table. then you could prompt for more information
and update the record. (or just write to the table after you have all
the info you want.)
Nov 13 '05 #5

P: n/a
Hi,

This is beginning to sound like a PIM...???
Do you have MS Outlook?
If so, use that instead of Access.

Don

"Shyguy" <sh****@aol.com> wrote in message
news:36********************************@4ax.com...
Thanks for the response. What I want to do is display a calendar on
the screen that would allow user to click in a days "box" and input
data. The "box" would also need to display any previously input data
when the calendar is opened. It would have to except 2 or 3 inputs
per date. I'm starting to think that this is not possible. ;-(
On Fri, 09 Jul 2004 02:16:24 GMT, "Don Leverton"
<le****************@telusplanet.net> wrote:
Hi,

Assuming that your Calendar *is* the default ActiveX one that ships with
Access...
and that the form that it is on is a bound form...
In this example the field that stores existing (or new) dates is named
"HoliDate".
The Calendar control is named "MyCalendar"

**********************************
Private Sub Form_Current()

Dim MyDate
MyDate = Me![Holidate]

Dim Msg As String
Msg = ""

Dim CR As String
CR = vbCrLf

If IsNull(MyDate) Then

Msg = Msg & "The current record does not contain a date ... " & CR & CR Msg = Msg & "The current date will be inserted by default, " & CR
Msg = Msg & "but can be changed by selecting a date from the calendar." MsgBox (Msg)
Me![MyCalendar].Value = Date
Me![Holidate] = Date

End If
End Sub

Private Sub MyCalendar_AfterUpdate()
'Yes, the AfterUpdate event can be used with an ActiveX calendar
'even though it is not included in the control's Property Sheet for reasonsunknown???

Me![Holidate] = Me![MyCalendar]
End Sub

**********************************

Nov 13 '05 #6

P: n/a
Thanks for the reply. Unfortunately I don't have the Developer
Handbook. Is the calendar available online by any chance?
On 9 Jul 2004 17:06:37 -0700, pi********@hotmail.com (Pieter Linden)
wrote:
Shyguy <sh****@aol.com> wrote in message news:<36********************************@4ax.com>. ..
Thanks for the response. What I want to do is display a calendar on
the screen that would allow user to click in a days "box" and input
data. The "box" would also need to display any previously input data
when the calendar is opened. It would have to except 2 or 3 inputs
per date. I'm starting to think that this is not possible. ;-(

If you're trying to create something like an Outlook appointment
calendar, maybe this would work...

Use the calendar form from the Developer Handbook, and write the
selected date to a table. then you could prompt for more information
and update the record. (or just write to the table after you have all
the info you want.)


Nov 13 '05 #7

P: n/a
Hi,
No. Not a PIM. ;-) I am trying to write a database for a Non Profit
Group that performs at churches. The database keeps track of all the
information related to the group, and the churches. Some days can
have two performances and some only one. Actually, I have everything
pretty much worked out, but the user needs to see if anything is
scheduled for any day so as not to double book. We can print out a
schedule and check that when making new inputs, but I thought it would
be smoother if it could be done on a calendar type form.

On Sat, 10 Jul 2004 00:11:50 GMT, "Don Leverton" <My*****@Telus.Net>
wrote:
Hi,

This is beginning to sound like a PIM...???
Do you have MS Outlook?
If so, use that instead of Access.

Don

"Shyguy" <sh****@aol.com> wrote in message
news:36********************************@4ax.com.. .
Thanks for the response. What I want to do is display a calendar on
the screen that would allow user to click in a days "box" and input
data. The "box" would also need to display any previously input data
when the calendar is opened. It would have to except 2 or 3 inputs
per date. I'm starting to think that this is not possible. ;-(
On Fri, 09 Jul 2004 02:16:24 GMT, "Don Leverton"
<le****************@telusplanet.net> wrote:
>Hi,
>
>Assuming that your Calendar *is* the default ActiveX one that ships with
>Access...
>and that the form that it is on is a bound form...
>In this example the field that stores existing (or new) dates is named
>"HoliDate".
>The Calendar control is named "MyCalendar"
>
>
>
>**********************************
>Private Sub Form_Current()
>
>Dim MyDate
>MyDate = Me![Holidate]
>
>Dim Msg As String
>Msg = ""
>
>Dim CR As String
>CR = vbCrLf
>
>If IsNull(MyDate) Then
>
> Msg = Msg & "The current record does not contain a date ... " & CR &CR > Msg = Msg & "The current date will be inserted by default, " & CR
> Msg = Msg & "but can be changed by selecting a date from thecalendar." > MsgBox (Msg)
> Me![MyCalendar].Value = Date
> Me![Holidate] = Date
>
>End If
>End Sub
>
>Private Sub MyCalendar_AfterUpdate()
>'Yes, the AfterUpdate event can be used with an ActiveX calendar
>'even though it is not included in the control's Property Sheet forreasons >unknown???
>
>Me![Holidate] = Me![MyCalendar]
>End Sub
>
>**********************************


Nov 13 '05 #8

P: n/a
Hi,

Ok then ... Using the analogy of the paper calendar that hangs in the
kitchen, the one that everyone scribbles their up-coming events on... is
that what you're talking about? If so, I don't know of any way to enter the
data directly into an Access "calendar type form" ... especially not
multiple entries.

I was quite serious about suggesting the use of a PIM.

The "monthy view" of the Outlook calendar displays a frame for each day.
Several events (5) will fit into the frame directly. Let's say that I typed
in "Don's Birthday" into one of the 5 event containers. Double-clicking on
that displays a window that has a large memo area that could contain the
detailed plan for that event. The Outlook calendar has a few other "bonus"
features, such as reminders and recurring events.If all of this this really
is not sufficient, then perhaps someone who knows more about integration
between Outlook and Access than I do could suggest something that may
satisfy your requirements???

Barring that, or if you insist on using Access only ... I do think that you
might be able to do something "workable" using 2 related tables and a
mainform/subform approach..

"tblAppointmentDates"
DateID - AutoNumber - PK
ApptDate - Date - Default Value = Date(), perhaps?
.... other fields

"tblAppointmentDetails"
ApptID -AutoNumber - PK
DateID - Long Integer - FK
ApptDate - Date
ApptMemo - Memo
.... other fields

Define a One-to-Many relationship between the 2 tables

Create the main form "frmAppointmentDates" (based on tblAppointmentDates)
Add the Calendar Control, and paste in my code posted previously.(You'll
have to modify the field names to match.)

Add a datasheet-style subform "sbfApptDetails" (based on
tblAppointmentDetails)
LinkMaster : DateID; ApptDate
LinkChild: DateID; ApptDate

It's best (IMHO) that you use datasheet-style for the subform, because you
want to be able to display as many Appointment records as possible.
You could create another single-record form also based on
tblAppointmentDetails "dlgAppointmentDetails" which would allow the user to
view all of the data in greater detail ... the memo field in particular.
This form could be "called" from the datasheet-style subform using
LinkCriteria, by say ... double-clicking in the ApptID field, like this:
**************************************
Private Sub ApptID_DblClick(Cancel As Integer)

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "dlgAppointmentDetails"

stLinkCriteria = "[ApptID]=" & Me![ApptID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

End Sub
**************************************
When you get this done, you should be able to click on a date on the
calendar to set the date on the main form. You will then be able to enter
and/or view existing appointment details in the subform. The
LinkMaster/LinkChild links will force the entry for ApptDate automatically,
in new records, as soon as data is entered in any other field.

The user could then "preview" the appointment in "sbfApptDetails", double
click on the desired "ApptID", and finally view all of the details in
"dlgAppointmentDetails". A few more steps, granted, than the average PIM,
but as I said before ... "workable"???

Don

"Shyguy" <sh****@aol.com> wrote in message
news:ma********************************@4ax.com...
Hi,
No. Not a PIM. ;-) I am trying to write a database for a Non Profit
Group that performs at churches. The database keeps track of all the
information related to the group, and the churches. Some days can
have two performances and some only one. Actually, I have everything
pretty much worked out, but the user needs to see if anything is
scheduled for any day so as not to double book. We can print out a
schedule and check that when making new inputs, but I thought it would
be smoother if it could be done on a calendar type form.

Nov 13 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.