Controlling the DatePicker

W

Wierdbeard65

Hi,

I need to be able to control which dates can be picked from a date-picker
control. At the very least, I need to limit dates to weekdays, but in various
circumstances, I also need to be able to block out other dates as well.

Is there any (relatively easy!) way to control which dates can be selected
and which ones are "greyed out"?

TIA
 
L

Linq Adams via AccessMonster.com

I don't think so. Best you can do, I think, is in the event where you're
assigning the date to a control, check the date selected and only assign it
if it's not Saturday or Sunday.

If Weekday(Me.DatePicker) = 1 Or Weekday(Me.DatePicker) = 7 Then
MsgBox "You Cannot Select a Saturday or a Sunday!"
Else
Me.DateTextBox = Me.DatePicker
End If

If you simply have to have the dates grayed out on the calendar, I think
you'll have to use one of the form-based calendars, such as Allen Browne's

http://allenbrowne.com/ser-51.html

and modify it to gray them out.
 
W

Wierdbeard65

Thanks!

I need to grey out other dates besides Saturdays and Sundays, so I'll check
out the link you posted.
 

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