Good Day and thank you in advance for your assistance. I am using Office 2003. As part of a form I have added a calendar pop up (From the control toolbox) which is working well except for one thing. The calendar is visable upon opening the form. I would like the calendar only to appear when the appropriate date field is clicked on. Please find my code below.
Option Compare Database
Option Explicit
Dim Orig As ComboBox
Private Sub Cal1_Click()
CBR.Value = Cal1.Value
CBR.SetFocus
Cal1.Visible = False
End Sub
Private Sub CBR_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Set Orig = CBR
Cal1.Visible = True
Cal1.SetFocus
If Not IsNull(CBR) Then
Cal1.Value = CBR.Value
Else
Cal1.Value = Date
End If
End Sub
Option Compare Database
Option Explicit
Dim Orig As ComboBox
Private Sub Cal1_Click()
CBR.Value = Cal1.Value
CBR.SetFocus
Cal1.Visible = False
End Sub
Private Sub CBR_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Set Orig = CBR
Cal1.Visible = True
Cal1.SetFocus
If Not IsNull(CBR) Then
Cal1.Value = CBR.Value
Else
Cal1.Value = Date
End If
End Sub