467,926 Members | 1,471 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,926 developers. It's quick & easy.

Calendar Control

I cant seem to set the date on the calendar control. What i want to
happen is have a form pop up when a button is clicked (have that part of
course). This for has a calendar control on it. I have the code to
pass the date selected back to the original form working just fine. I
want to have the calendar start with whatever the current date is as the
selected date -or- a specificed date passed to the form (by a global
variable) based on a condition. I know how to test the condition with
an IF loop. I just can't seem to set the date on the calandar control
when the form opens. Any help please?
Nov 12 '05 #1
  • viewed: 1543
Share:
2 Replies
Ima Lostsoul <me@myprovider.com> wrote in message news:<MP************************@netnews.comcast.n et>...
I cant seem to set the date on the calendar control. What i want to
happen is have a form pop up when a button is clicked (have that part of
course). This for has a calendar control on it. I have the code to
pass the date selected back to the original form working just fine. I
want to have the calendar start with whatever the current date is as the
selected date -or- a specificed date passed to the form (by a global
variable) based on a condition. I know how to test the condition with
an IF loop. I just can't seem to set the date on the calandar control
when the form opens. Any help please?

In the On Open event of your calendar control put this code.

Private Sub SelectDate_Open(Cancel As Integer)
Forms!frmYourFormName!CalendarControlName.Value = Date
End Sub

This will open the calendar control with the current date. I think you
will find that the calendar control does not have its own open event
procedure, so Just type the code in.

David
Nov 12 '05 #2
In article <MP************************@netnews.comcast.net> ,
me@myprovider.com says...
I cant seem to set the date on the calendar control. What i want to
happen is have a form pop up when a button is clicked (have that part of
course). This for has a calendar control on it. I have the code to
pass the date selected back to the original form working just fine. I
want to have the calendar start with whatever the current date is as the
selected date -or- a specificed date passed to the form (by a global
variable) based on a condition. I know how to test the condition with
an IF loop. I just can't seem to set the date on the calandar control
when the form opens. Any help please?

Never mind. I was being stupid...
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Tim Graichen | last post: by
5 posts views Thread by Miguel Dias Moura | last post: by
1 post views Thread by bill yeager | last post: by
reply views Thread by maxrawson | last post: by
2 posts views Thread by Caesar Augustus | last post: by
3 posts views Thread by Peter | last post: by
3 posts views Thread by =?Utf-8?B?UGFycm90?= | last post: by
7 posts views Thread by John Kotuby | last post: by
6 posts views Thread by thorpk | last post: by
3 posts views Thread by thorpk | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.