Trying to add an Access Calendar

  • Thread starter Thread starter ryguy7272
  • Start date Start date
R

ryguy7272

I have a quick question about adding an Access Calendar. I tried to follow
the example at this site:
http://www.fontstuff.com/access/acctut09.htm


This is my VBA:
Option Compare Database
Option Explicit
Dim cboOriginator As TextBox

Private Sub ConsultDate_DblClick(Cancel As Integer)
' Note which combo box called the calendar
Set cboOriginator = ConsultDate
' Unhide the calendar and give it the focus
ocxCalendar.Visible = True
ocxCalendar.SetFocus
' Match calendar date to existing date if present or today's date
If Not IsNull(cboOriginator) Then
ocxCalendar.Value = cboOriginator.Value
Else
ocxCalendar.Value = Date
End If
End Sub

Note: I am using a TextBox, not a ComboBox, as in the example. I don’t
think this is the issue, but I just wanted to throw it out there…

When I double-Click the TextBox named ConsultDate, I get a message that says
‘Compile Error: Variable not Defined’

This line of code is yellow:
Private Sub ConsultDate_DblClick(Cancel As Integer)

Please let me know what I am doing wrong.

Thanks,
Ryan---

PS, is there any way to export the Form in the example that is available for
download? I may be able to export the Form from the example at the link
mentioned above, and import it into my DB. This is VERY easy to do in Excel.
 
I don't know if you've tried it or not (you seem to have it figured out), but
Lebans month calendar was by far the best one available (IMHO) and requires
no extra references or activeX controls. Very very user friendly (view 1-12
months at a time, change colors, default date, ect)

http://www.lebans.com/monthcalendar.htm
 
Back
Top