Calendar Control Changes Month

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

I'm using AC 2007. I have 2 Calendar Controls on a form. I want one cal
to display the current month and the other to display the next month. I have
this code in the OnLoad of the form:

Private Sub Form_Load()

Me.ctlCal.Value = Now()
Me!ctlCalNextMonth.NextMonth
Me!ctlCalNextMonth.Value = "" 'this is to prevent the highlighting
of a date

End Sub

What happens is when I put the form i design view and save changes
ctlCalNextMonth
displays a different month at runtime and in design view. Seems when I
delete and then
create a new cal control it's ok until I put the form in design view.
I'm sure there's a better way to have the control display the next month.

Any help will be appreciated,
James
 
I found the property in a book and it was the onclick of a command button.
It would advance a Calendar Control 1 month so I gave it a shot.

I pasted the example but I got a error saying does not support the property
or
method or something to that effect. I removed the .NextMonth and it seems
to have done the trick. The Calendar Control is displaying June.

Me!ctlCalNextMonth = DateSerial(Year(Date), Month(Date) + 1, 1)

Not familiar with date functions or expressions so I appreciate the help

Thanks,
James
 
Back
Top