Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar control returns 12/30/1899

Status
Not open for further replies.

pduncan

IS-IT--Management
Jun 20, 2003
203
US
I have a calendar control that when you click it the first time returns the date as 12/30/1899. When you click it the second time it is right. Can someone tell me how to have the control return the date properly?
Here is the code associated with the control:
Code:
Private Sub ocxCalendar_Click()

    cboDate.Value = ocxCalendar.Value
    cboDate.SetFocus
    ocxCalendar.Visible = False
    

End Sub

Thanks, PDUNCAN
Memphis, TN - USA
When I die, I want to die like my grandfather-- who died peacefully in
his sleep. Not screaming like all the passengers in his car.
 
This is how I coded a calendar control to pick up any date already in the date field or open to todays date.

If Not IsNull(Forms!FormName!CtlName) Then
s_Date = Forms!FormName!CtlName
Else
s_Date = CStr(Now)
End If

DoCmd.OpenForm "FormName", , , , , , s_Date

Hope it gives you ideas

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top