Calendar object in form

  • Thread starter KHogwood-Thompson
  • Start date
K

KHogwood-Thompson

Hi All,

I have a form for users to be able to request holidays, this form has two
calendar objects within it, one called FromDateCal and the other is called
ToDateCal.

I would like the FromDateCal object to have a default date selected of
today's date, when the user selects a date other than today's date (most
likely in all cases), I would like the default date of the ToDateCal object
to be at least one day greater than that selected in the FromDateCal.

Is that possible with code?
I am not even sure that I need 2 calendar objects so would be grateful for
any advice on how to handle this.

Many thanks
 
D

Doug Robbins - Word MVP

Usually unnecessary, but in the Initialize event for the from include the
command:

FromDateCal.Value = Date

For the other part, use

Private Sub FromDateCal_Click()
ToDateCal.Value = FromDateCal.Value + 1

End Sub


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
K

KHogwood-Thompson

Thanks for the advice, but my Calendar object does not have an Initialize
event!
 
D

Doug Robbins - Word MVP

It's the form that has the initialize event, not the Calendar control.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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