Calendar Control...any tips?

R

Robert Robinson

I am using Calendar Control to assist with date entry. It works OK, but are
there ways to improve it:

1) Can the calendar be a "pop up" calendar (activated when a user clicks on
the "date") field?
2) Can the calendar be set up to have the current date pre-selected (I mean,
when a person enters the form or activates the "pop up", can today's date be
highlighted?)
3) With my current setup the user clicks on the date, but the date selected
does not appear in the date field until the user moves on to the next field.
What do I need to do to make the date appear when a date on the calendar is
clicked?

Thanks again everyone for all of your help so far...these forums have
increased my knowledge base exponentially!!!
 
P

PC Datasheet

1. Create a pop-up form and put the calendar control on the pop-up form.
Place a button next to you date field and put the following code in the
button's click event:
DoCmd.OpenForm "PFrmCalendar"

2. Put the following code in the Open event of PFrmCalendar:
Me!nameOfCalendarControl.Value = Date()

3. Put the following code in the AfterUpdate event of the calendar control:
Forms!NameOfFormWithDateField!NameOfDateField =
Me!nameOfCalendarControl.Value
 
R

Robert Robinson

VERY elegant. Thanks.

Of course, when I showed the solution to the office manager, I heard "That's
great, but...can we do away with the pop up solution and leave the calendar
on the form as it was before? and oh yeah, can you keep the date pre
selection and set it up where the date appears in the field when a date on
the calendar is clicked (welcome to programming)...

So I still want to do 2) and 3), only without the popup form. I tried
retrofitting your solutions from the popup form to the static calendar that I
created, but could not get them to work. The syntax for these Do commands
should not change that much, should they?
 
P

PC Datasheet

2. Put the following code in the Current event of your form:
Me!nameOfCalendarControl.Value = Date()

3. Put the following code in the AfterUpdate event of the calendar
control:
Me!NameOfDateField = Me!nameOfCalendarControl.Value
Me!nameOfCalendarControl.Value = Date()

3 will set the date in your date field and then go back to today's date.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 

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