ShabanaHafiz
Programmer
I am using MS Office Access 2003.
I created a Pop-Up Calendar on my form as follows (the form is bound to a table):
1. Insert -> ActiveX Control -> Calendar Control 11.0
2. Calendar Control (Name: Calendar; Visible No)
3. Added the following code to the MouseDown event of the cboDateOfTravel combo box:
4. Added the following code to the Click event of the Calendar control:
Before inserting the calendar control, I wrote the following in the Change event of cboDateOfTravel:
The change event was firing. But after inserting the calendar control, Change event for cboDateOfTravel does not fire when the date is changed and Combo Box gets a new value.
I created a Pop-Up Calendar on my form as follows (the form is bound to a table):
1. Insert -> ActiveX Control -> Calendar Control 11.0
2. Calendar Control (Name: Calendar; Visible No)
3. Added the following code to the MouseDown event of the cboDateOfTravel combo box:
Code:
Private Sub cboDateOfTravel_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Calendar.Visible = True
Calendar.SetFocus
Calendar.Value = IIf(IsNull(cboDateOfTravel), Date, cboDateOfTravel.Value)
End Sub
4. Added the following code to the Click event of the Calendar control:
Code:
Private Sub Calendar_Click()
cboDateOfTravel.Value = Calendar.Value
cboDateOfTravel.SetFocus
Calendar.Visible = False
End Sub
Before inserting the calendar control, I wrote the following in the Change event of cboDateOfTravel:
Code:
Private Sub cboDateOfTravel_Change()
EnableControls False, True, True, False
End Sub
The change event was firing. But after inserting the calendar control, Change event for cboDateOfTravel does not fire when the date is changed and Combo Box gets a new value.