By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,637 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,637 IT Pros & Developers. It's quick & easy.

Access Calendar Control 11.0 12/1899 Date Problem

P: n/a
Hello all, and thank you in advance for your assistance.

I'm pretty new to access and I'm trying to teach myself some VBA by
using various bits of code I find here and there mixed with my own.
I've seen mentions of this issue in other forums, but haven't found an
ansewer (at least one I understand lol) in other postings.

I have a text box that users need to input a short date into. I tried
using a Access's built in calendar control 11.0 so that users can just
click on the date. The calender is hidden until someone clicks a
command button, then the calendar opens, someone selects the date, the
calendar closes. The problem is that when you first attempt to enter
the date, it shows the date as 12/30/1899. I'll post my code below,
and if anyone sees what I've done wrong or am missing, would you please
explain it in a way so that my 5yr old can understand it so he can
explain it to me? LoL btw 1 calendar is being used to fill in 2
seperate text boxes.

Again, thanks in advance for your help

Option Compare Database
Dim cboOriginator As TextBox

Private Sub Calendar3_Click()

cboOriginator.Value = Calendar3.Value
issue_type.SetFocus
Calendar3.Visible = False
Set cboOriginator = Nothing

End Sub

Private Sub Command25_Click()

Set cboOriginator = issue_date
Calendar3.Visible = True
Calendar3.SetFocus
If Not IsNull(cboorigionator) Then
Calendar3.Value = cboOriginator.Value
Else
Calendar3.Value = Now()
End If

End Sub

Private Sub Command29_Click()

Set cboOriginator = date_due
Calendar3.Visible = True
Calendar3.SetFocus
If Not IsNull(cboOriginator) Then
Calendar3.Value = cboOriginator.Value
Else
Calendar3.Value = Now()
End If

End Sub

Aug 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
There are several problems with these ActiveX controls.

Here's a simple little Access form that you can use instead to enter any
date, without the need for any extra controls:
Popup calendar
at:
http://allenbrowne.com/ser-51.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"afr0ninja" <mo**************@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Hello all, and thank you in advance for your assistance.

I'm pretty new to access and I'm trying to teach myself some VBA by
using various bits of code I find here and there mixed with my own.
I've seen mentions of this issue in other forums, but haven't found an
ansewer (at least one I understand lol) in other postings.

I have a text box that users need to input a short date into. I tried
using a Access's built in calendar control 11.0 so that users can just
click on the date. The calender is hidden until someone clicks a
command button, then the calendar opens, someone selects the date, the
calendar closes. The problem is that when you first attempt to enter
the date, it shows the date as 12/30/1899. I'll post my code below,
and if anyone sees what I've done wrong or am missing, would you please
explain it in a way so that my 5yr old can understand it so he can
explain it to me? LoL btw 1 calendar is being used to fill in 2
seperate text boxes.

Again, thanks in advance for your help

Option Compare Database
Dim cboOriginator As TextBox

Private Sub Calendar3_Click()

cboOriginator.Value = Calendar3.Value
issue_type.SetFocus
Calendar3.Visible = False
Set cboOriginator = Nothing
End Sub

Private Sub Command25_Click()

Set cboOriginator = issue_date
Calendar3.Visible = True
Calendar3.SetFocus
If Not IsNull(cboorigionator) Then
Calendar3.Value = cboOriginator.Value
Else
Calendar3.Value = Now()
End If
End Sub

Private Sub Command29_Click()

Set cboOriginator = date_due
Calendar3.Visible = True
Calendar3.SetFocus
If Not IsNull(cboOriginator) Then
Calendar3.Value = cboOriginator.Value
Else
Calendar3.Value = Now()
End If
End Sub

Aug 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.