I have inserted the Microsoft ActiveX MonthView Control, version 6.0, on an
HTA page as the <OBJECT> MonthView1.
I want the user to select a date from the calendar, with the selected date
being displayed immediately as a string which represents the MonthView
object's "value" property. In my example I am displaying the string in the
document title.
But I haven't been able to trigger this immediate response. As you can see
from the following demo, I can make the date string appear in response to
the MonthView object's "ondeactivate" event, when the user selects a date
and then clicks outside the object.
I can also make the string appear in response to the click of a button
external to the object.
I have tried using the events "onclick" and "onpropertychange" instead of
"ondeactivate", but the MonthView object does not seem to recognize these.
You can save the <html> below as "MonthView.hta" and run it.
Any suggestions? (I was wondering if VBScript, of which I have little
knowledge, might do the job where Javascript fails.)
Thanks.
David
-------------------- DEMO------------------
<html>
<title>MonthView test</title>
<head>
<script href="" type="text/javascript">
function test(){
document.title="Button click: " + MonthView1.value;
} // test()
</script>
</head>
<body onload="testbut.focus()">
<p>Use the calendar to select a date. Then click anywhere outside the
calendar. The selected date will appear in the title bar in response to the
"ondeactivate" event.</p>
<p>You can also select a date and then click on the 'Show selected date
value' button to get a similar result.</p>
<p><i>But how can I get the selected date to display every time the user
clicks on the calendar?</i></p>
<OBJECT ID="MonthView1" WIDTH=180 HEIGHT=159
CLASSID="CLSID:232E456A-87C3-11D1-8BE3-0000F8754DA1"
ondeactivate="document.title='ondeactivate: ' + this.value">
<PARAM NAME="_ExtentX" VALUE="4763">
<PARAM NAME="_ExtentY" VALUE="4180">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="ShowToday" VALUE="0">
<PARAM NAME="StartOfWeek" VALUE="662831105">
</OBJECT>
<br/><br/>
<button id="testbut" type="button" onclick="test()">Show selected date
value</button>
</body>
</html>
Douglas J. Steele - 30 Jan 2006 22:29 GMT
I'd suggest asking this in the appropriate scripting group
(microsoft.public.scripting.jscript or microsoft.public.scripting.vbscript).
This newsgroup is for questions about using ActiveX controls with Access,
the database product that's part of Office Professional.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
>I have inserted the Microsoft ActiveX MonthView Control, version 6.0, on an
>HTA page as the <OBJECT> MonthView1.
[quoted text clipped - 61 lines]
> </body>
> </html>
David Mayerovitch - 31 Jan 2006 00:06 GMT
My mistake. Sorry.
> I'd suggest asking this in the appropriate scripting group
> (microsoft.public.scripting.jscript or
[quoted text clipped - 69 lines]
>> </body>
>> </html>