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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting current date on Active X calendar

Status
Not open for further replies.

Creosote65

Technical User
Jun 28, 2004
29
US
Hi all,

I've added a popup calendar to an Access form, which is pretty straightforward. When I double-click a date, it will populate a field on my form and close the popup. I have been trying to play with the object properties to make it default to the current date, it doesn't seem to accept the "=now()" setting for the default value property.

Is there another approach that I might take, maybe by setting the current date through a variable?

Here is the underlying vba so far:

1 Private Sub actlCalendar_DblClick()
2 Dim dtmDate As Date

3 'To set the date control to date selected on the calendar

4 dtmDate = Me.ActiveControl.Value
5 DoCmd.Close acForm, Me.Name
6 Screen.ActiveControl.Value = dtmDate

7 End Sub

Thanks,
Pierre
 
In the Load event procedure of the form you may try something lke this:
Me![name of calendar control].Value = Date()

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top