473,769 Members | 7,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calendar Control 10.0 Missing Events

I am trying use a Calendar Control 10.0 in one of my forms. (I am
using access 2002)

What I want to do is have the user click a button which makes the
calendar visible. Then when the user clicks on a date, it sends it to
a text box and then the calendar should disappear.

All of the examples I have been able to track down seem to use events
that aren't available to me. Most notably, any click events.

When I bring up the proprites for the calendar and select the events
tab, I have the followng list of Events:
On Updated
On Enter
On Exit
On Got Focus
On Lost Focus

There are no other events listed. Can someone help me figure out how
to get this control to respond to the user clicking one of the calendar
dates?

Thank you,

Jody Blau

Feb 12 '06 #1
2 3765
The Onclick event is available even though it isn't shown in the
properties sheet. Use something like:

Private Sub MyCal_click()
Me!MyTextBox = Me!MyCal.Value

HTH

Feb 12 '06 #2
> What I want to do is have the user click a button which makes the
calendar visible. Then when the user clicks on a date, it sends it to
a text box and then the calendar should disappear.


I encountered this exact same issue. I put the calendar control in a popup
form and passed a comma-delimited string in OpenArgs:

[frmPopupCalenda r]
Option Compare Database
Option Explicit
Private m_astrOpenArgs( ) As String

Private Sub Form_Open(Cance l As Integer)
m_astrOpenArgs = Split(Me.OpenAr gs, ",")
End Sub

I have a number of forms/subforms in my app that use the calendar control.
Each has a button that opens the popup form with an OpenArgs parameter like
this:

"frmFormName,fr mSubFormName,fr mNestedSubFormN ame,txtControlN ame,strPopupFor mCaption"

If a parameter is not needed, I just leave it blank:

"frmMain,txtMyD ate,,,,Please Select a Transaction Date"

In the AfterUpdate event of the Calendar control, I have this:

Private Sub MyCalendarContr ol_AfterUpdate( )
Call SetDateOnClose( m_astrOpenArgs( 0), m_astrOpenArgs( 1), _
m_astrOpenArgs( 2), m_astrOpenArgs( 3))
DoCmd.Close acForm, "frmPopupCalend ar"
End Sub

Here is SetDateOnClose:

Private Sub SetDateOnClose( strFrm As String, strCtl As String, _
strSubFrm As String, strSubFrmCtl As String)
If Len(strSubFrmCt l) = 0 Then
If Len(strSubFrm) = 0 Then
Forms(strFrm).C ontrols(strCtl) = _
CDate(Me!MyCale ndarControl.Val ue & " 12:00:01 AM")
Else
Forms(strFrm).C ontrols(strCtl) .Form.Controls( strSubFrm) = _
CDate(Me!MyCale ndarControl.Val ue & " 12:00:01 AM")
End If
Else
Forms(strFrm).C ontrols(strCtl) .Form.Controls _
(strSubFrm).For m.Controls(strS ubFrmCtl) = _
CDate(Me!MyCale ndarControl.Val ue & " 12:00:01 AM")
End If
End Sub

The only reason I append "12:00:01 AM" is because I have logic elsewhere
that needs a date with a time value.

I often want the calendar to display a particular date on open - usually the
date that's in the control on the form from which the calendar was opened:

Private Sub Form_Load()
Me!ApptCal.Valu e = GetDateOnLoad(m _astrOpenArgs(0 ), m_astrOpenArgs( 1), _
m_astrOpenArgs( 2), m_astrOpenArgs( 3))
Me.Caption = m_astrOpenArgs( 4)
End Sub

Private Function GetDateOnLoad(s trFrm As String, strCtl As String, _
strSubFrm As String, strSubFrmCtl As String) As Date
On Error GoTo HandleErr
If Len(strSubFrmCt l) = 0 Then
If Len(strSubFrm) = 0 Then
Me!ApptCal.Valu e = Nz(Forms(strFrm ).Controls(strC tl), Date)
Else
Me!ApptCal.Valu e = Nz(Forms(strFrm ).Controls(strC tl).Form. _
Controls(strSub Frm), Date)
End If
Else
Me!ApptCal.Valu e = Nz(Forms(strFrm ).Controls(strC tl).Form.Contro ls _
(strSubFrm).For m.Controls(strS ubFrmCtl), Date)
End If
End Function

Feb 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2458
by: Shyguy | last post by:
Is it possible to create a calendar that shows previous input data and also allows for input of new data?
0
971
by: John Slate | last post by:
Is there any way to control the height and width of a cell when using the asp calendar control? I am using it to display a calendar of events. Even though each cell will contain only a word or two (not really enough to push the sizes of the default cell), the text is still forcing the cells to be larger than necessary, causing some asthetic problems. I can't find a property that controls this. Am I missing something? *** Sent via...
7
2691
by: Colin Young | last post by:
I have a UserControl that contains a calendar control. The calendar is not raising events (month navigation, date selections, etc.). I've checked that the OnSelectionChanged event has a handler being registered. Is there anything else obvious or otherwise that I've missed? Is there a problem using it in a UserControl? Thanks Colin
5
4600
by: Miguel Dias Moura | last post by:
Hello, i am trying to create a .css file with several styles and apply them to the calendar control so i can change the look of: 1. Text Type and Format (Bold, Underline, etc) 2. Background Color 3. Foreground Color 4. Border Tickness 5. Border Color
3
1192
by: Luis E Valencia | last post by:
I have a table that says for example 01/05/2004 Party IIsadpaks 01/06/2004 Party 2394923423 A events table. I want to make a calendar and that the days that are events are inbold and with a link to a detail of the events of that day.
4
6699
by: Jason Chan | last post by:
How can I get the month and year a calendar control current displaying? My problem is I want to load a list of event to a calendar so that it display difference style if there a event for a day. My initial idea is load all events from database and store it in a DataTable. In the DayRender event, loop thr the DataTable and see if it equal to e.Day and alter the style if that is. However when the event table is large, it hurt...
6
6112
by: Sridhar | last post by:
Hi, I need to display a calendar that shows all the months of an year. In that, I need to show different colors for certain events. I know how to display a calendar for a certain month but I am not sure if there is a way to display all the months of an year? Please let me know. Thanks, Sridhar.
6
2247
by: hal | last post by:
Hello All, I got this code somewhere, so i'm not even sure if this is the best way to do this. Basically what i want is to display events in an asp.net calendar control which i'm able to do, but not when i have two events on the same day. I'm getting the data for the events from an XML file. Here's my code. aspx page just has the calendar control.
1
4908
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.