Hi "JingleBEV",
I'm confused...
Are you telling me that you:
----------------------------
1.) Select a date on the calendar which inserts the selected date value into
a textbox? (Is this a bound or unbound textbox? ... It sounds like a bound
field to me, now.)
2.) Then you use the command button to toggle the calendar's .Visible
Property? If it *is* visible when you click the button, it becomes
invisible, and vise-versa? If so, that seems bizarre to me ... why would you
want to do that?
3.) Next you use the date that you just inserted into the textbox to
"highlight" a date on your calendar?
If this textbox is a bound control, I'd suggest doing it this way:
-------------------------------------------------------------
1.) Test its value using the IsDate() function in the form's On Current
event.
2.) If it contains a valid date value, then assign the calendars .Value
property to the value in the textbox, which has the same effect as setting
your .Day, .Month, .Year properties as you have done below.
3.) This "test" could also be used to determine the calendar's .Visible
property. If it contains a valid date, display the calendar... if not, then
hide the calendar.
Don
"JingleBEV" <n_****@NOSPAMyahoo.com> wrote in message
news:tO*******************@news20.bellglobal.com.. .
Don,
Thanks for the quick response. I figured it out and it works, the code
looks like this:
'***************************
Private Sub Command1_Click()
Dim d As Date
Calendar1.Visible = Not Calendar1.Visible
d = CDate(txtCalendar.Mask)
Calendar1.Day = DatePart("d", d)
Calendar1.Month = DatePart("m", d)
Calendar1.Year = DatePart("yyyy", d)
End Sub
'*************************************
I already know that it's a valid date, because it's generated by the
calendar control.