calendar problem - leban

T

Theo

Can't get this to work. This is Leban's code. I get an error message on this
******* "Compile error. User defined type not defined.
OK - I've clearly missed a step, but I can't tell where.
I am a newbie! Any suggestions?

Option Compare Database
Option Explicit


' This declares the MonthCalendar Class
Private mc As clsMonthCal **********

Private Sub Form_Load()

' Create an instance of our Class
Set mc = New clsMonthCal
' Set the hWndForm Property
mc.hWndForm = Me.Hwnd

End Sub

Private Sub Form_Unload(Cancel As Integer)

' This is required in case user Closes Form with the
' Calendar still open. It also handles when the
' user closes the application with the Calendar still open.

If Not mc Is Nothing Then
If mc.IsCalendar Then
Cancel = 1
Exit Sub
End If


Set mc = Nothing
End If

End Sub

Private Sub EventDate_DblClick(Cancel As Integer)

Dim blRet As Boolean
Dim dtStart As Date, dtEnd As Date

dtStart = Nz(Me.EventDate.Value, 0)
dtEnd = 0

blRet = ShowMonthCalendar(mc, dtStart, dtEnd)
If blRet = True Then
Me.txtSelectDate = dtStart
Else
' Add any message here if you want to
' inform the user that no date was selected
End If

End Sub

End Sub
 
S

Steve Sanford

Hi Theo,

1) Do you have a reference set to Microsoft DAO 3.6 Object Library?

2) Did you follow steps 1 & 2 in the instructions??

One of the 5 modules you *must* import is the Class code module
"clsMonthCal". Without this module you will get the error you report.

I downloaded the zip file of the demo.... the demo works without an error.
So I think you didn't import the additional 5 modules...

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top