Using a Calendar to selext a date

brag89

New member
Local time
Today, 19:24
Joined
Nov 26, 2002
Messages
5
I have a table called Contracts that uses a form called AddContract to add records. One of the fields is set up as a date field as it asks the user to enter the start date of a contract. Rather than manually type in the date I would like to know if when the field is selected a calendar pops up which allows the user to click on the appropriate date.

Thanks

Brag
 
There is an ActiveX Control called Calendar that you will find under the Other Tools icon on the Toolbox menu. Add that control to your form and set its Visible Property to No. Then you can use code in the On Enter event of the date field to set the Calendars visible property to Yes. The Calendar control does not have a Click event so you have to write that subroutine yourself. It might look something like this:

Private Sub Calendar_Click()
Me.DateFieldName = Me.Calendar.Value
Me.Calendar.Visible = False
End Sub

hth,
Jack
 

Users who are viewing this thread

Back
Top Bottom