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