Calendar Control 10...setting a default value

Can the calendar control be set so that by default it displays the current date? I put one into a form I'm working on and everytime I open it it highlights 3/23/05 (the creation date). I cant use a hard value because I want it to display the current date as a default. It is being used to select a day to pull a report from and the most common is current day. I tried putting date() in value property...no go oon that. Did not see a default value area or anything. Please help!!! Thanks!
LVL 15
dbase118Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shanesuebsahakarnCommented:
You could programmatically set it in the form's Open event (or better yet, ditch the Calendar control completely and write your own :-)
0
Steve BinkCommented:
On my form, I did it like this:

Me.Calendar4.Value = "4/1/1985"

You can set the value, for example, in the form's OnLoad event:

Private Sub Form_Load()

Me.MyCalendarControl.Value = "4/1/1985"

End Sub

Additionally, look in the object browser for the different methods associated with the control.  There are methods to increment the day, month, or year, or even set the control to today's date.
0
dbase118Author Commented:
"You could programmatically set it in the form's Open event (or better yet, ditch the Calendar control completely and write your own :-)"----Im afraid I am programmatically challenged.

I actually did try setting it OnOpen but he problem with setting the value is that once it was written into the Value property, I could not change by clicking a new date.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Mike EghtebasDatabase and Application DeveloperCommented:
CalendarControlName = Date()

in form's Open event as stated above.
0
Steve BinkCommented:
Try this:

1) Create a new form.  Place a calendar control (called MyCalendar) and a command button (called MyButton) on the form.
2) For the button, right click, and select "Build Event.."  When you get to the code window, make sure you are editing the OnClick event.
3) Make the event look exactly like what is shown below:

Private Sub MyButton_Click()   '<--- If you named your button differently, this line should reflect YOUR button's name
Me.MyCalendar.Value = "4/1/1985"
End Sub

4) Run the form.  Select a date on the calendar control.  Click the button.  Select a date.  Click the button.  So on.  Understand?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dbase118Author Commented:
Thanks for the help....Gave you both points. In actuality...I had the right idea all along but before I could set the value in the On Open. I had to change the ValueIsNull property to yes or the OnOpen would not overwrite. So It was essentially
something like

Forms![EOD Report Log].Calendar2.Value=date
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.