Setting ActiveX Calendar Properties

B

Bill

My application uses the Access ActiveX
Calendar to set a text-box control based
on the user's selection within the calendar.

I tried to initialize the calendar's control to
the current date in the form's Open thus:

Me.ctlCal.Value = Date

Where ctlCal is the calendar's control. The
property sheet for the control clearly shows
the "Value" property, but the statement
above had no affect.

What's up with that?

The extended property sheet via "Custom"
also shows a Value property.

Thanks,
Bill
 
B

Bill

Thanks Arvin,
I'll be back in a few hours to give Calendar2K
try. (While I'm developing the current application
in A2003, the mde will be hosted by A2007 and
potentially compiled in the A2007 environment.)
Bill
 
B

Bill

Arvin,
I'm trying to use "frmCalendar" as a subform to
the parent form "TransAccounting". When the
frmCalendar OnClick fires, I want the selected
date put into the tbDate control. When the code
runs as you see it below, the date is instead
stored into the frmCalendar control corresponding
to the date selected. I.e., into the calendar itself.

I also tried:
form!TransAccounting.[tbDate] = Screen.ActiveControl
But that doesn't make any difference.

Private Function setdate()
On Error GoTo error_hand
Me.Parent.tbDate = Screen.ActiveControl
'ctldate = Screen.ActiveControl
error_hand:
Resume Next
End Function

What do I need here to store the selected date into
the tbDate text box on the parent form?

Thanks,
Bill
 
M

mbyerley

Bill,
I also have an all Access calendar with a demo to show you several ways to
get your date that is selected in an appropriate field.

It is located at: http://www.byerley.net/AllAccessCal.zip

There are also a plethora of links to others at Jeff Conrads site:

http://www.accessmvp.com/JConrad/accessjunkie/calendars.html




Bill said:
Arvin,
I'm trying to use "frmCalendar" as a subform to
the parent form "TransAccounting". When the
frmCalendar OnClick fires, I want the selected
date put into the tbDate control. When the code
runs as you see it below, the date is instead
stored into the frmCalendar control corresponding
to the date selected. I.e., into the calendar itself.

I also tried:
form!TransAccounting.[tbDate] = Screen.ActiveControl
But that doesn't make any difference.

Private Function setdate()
On Error GoTo error_hand
Me.Parent.tbDate = Screen.ActiveControl
'ctldate = Screen.ActiveControl
error_hand:
Resume Next
End Function

What do I need here to store the selected date into
the tbDate text box on the parent form?

Thanks,
Bill

Arvin Meyer said:
I think that you'll be happier with a native Access calendar form like the
one at:

http://www.datastrat.com/Download/Calendar2K.zip

since Microsoft no longer supports ActiveX controls in the latest Access
format.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
Co-author: "Access Solutions", published by Wiley
 
B

Bill

Arvin,
Not sure exactly why this is working now, but
here's the code for the command button OnClick:

Private Sub cmdCalendar_Click()
Me.frmADFCalendar.Visible = True
Me.tbDate.SetFocus
Call PopCalendar
Me.frmADFCalendar.Visible = False
End Sub

Your code runs as distributed with the exception
of my setting the mouse to a pointer while the
calendar selection is active.

I think what made things work with an un-bound
text box was the SetFocus of the text box control
before I called the PopCalendar.

I hope all of this makes sense.

Thanks,
Bill
 

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