Calendar in text box...

Dezirous

Rafi Ahmed
Local time
Tomorrow, 01:22
Joined
Jul 8, 2009
Messages
71
Hello All Experts;

I have a bound form with a query. In this form, there is a bound text box with data type (Date/Time). Now I want Calendar in this field like VB Date picker combo box.

Is it possible in Access...? or any idea about fastest date selection rather then typing...!
 
Have you tried using the Date and Time picker found in your references?
 
There is no component with this name in my reference list. How could I install DateTime Picker component or where could I find it...?
 
In the design view of your form select Insert > ActiveX control and press the letter M to take you to the first one beginning with M then scroll down until you find Microsoft Date and Time Picker Control, version n.n

Then click Ok

David
 
Once you fimd the DatePicker ActiveX control, if you'd like to only have it appear when you need to pick a date, you can use this routine.

YourTextBoxName is the name of the box that will hold the date

YourDatePickerName is the name of your DatePicker.

First, place the DatePicker where you want it to appear on the form.

Next, select the DatePicker and goto Properties--Format and set Visible = No

Then place this code in the form's code module:

Code:
Private Sub Form_Load()
   YourDatePickerName = Date
End Sub

Code:
Private Sub YourDatePickerName_Click()
   YourTextBoxName = YourDatePickerName
   YourTextBoxName.SetFocus
   YourDatePickerName.Visible = False
End Sub

Code:
Private Sub YourTextBoxName_DblClick(Cancel As Integer)
  YourDatePickerName.Visible = True
End Sub

Now, when your user DoubleClicks on the textbox where the date will go, the DatePicker will appear. The date is picked, and the DatePicker disappears!
 

Users who are viewing this thread

Back
Top Bottom