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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Calendar object

Status
Not open for further replies.

Nick34

Technical User
Oct 16, 2003
50
US
I am trying to set an object variable to a calendar object that I have created on a form. I can't seem to get this. What is the syntax for referring to a calendar control???
 
For example, SelectDate is the name of your ActiveX calendar control. StartDate is the name of the text box. The syntax would be StartDate = SelectDate.Value. This applies for Access97
 
This is the code I'm working with:

Dim oCal As MSACAL.Calendar
Dim pdCalendarReportDate As Date

Set oCal = Forms("Switchboard Subform QC")!ReportDateCalendar
pdCalendarReportDate = oCal.Value
Debug.Print pdCalendarReportDate

Set oCal = Nothing

The Set command is whereI am running into trouble.
 
Set oCal = Forms("Switchboard Subform QC").ReportDateCalendar

using the bang (!) indicates the field behind the form called ReportDateCalendar, not the object on the form called ReportDateCalendar.

hth

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
 
I have tried that syntax, but am getting the error message "Type mismatch" Why is that?
 
Try:
Dim oCal As Object

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top