This is the code which calls a class module to bring the calendar.
Private Sub cmdCalender_Click()
Dim strMsg As String
Dim strMsg1 As String
Dim strMsg2 As String
Dim blSuccess As Boolean
txtAppDate = ShowMonthCalendar(mc, Date, Date, , , True)
strMsg = "You have selected a date, thats already expired."
strMsg1 = "You have selected a date, greather then today."
strMsg2 = "Are you Sure this is the Correct Date?"
If txtAppDate < Date Then
If MsgBox(strMsg, vbOKCancel, "Date Error") = vbCancel Then
txtAppDate = ""
End If
ElseIf txtAppDate > Date Then
If MsgBox(strMsg1, vbOKCancel, "Date Error") = vbCancel Then
txtAppDate = ""
End If
End If
If MsgBox(strMsg2, vbOKCancel + vbQuestion, "Date Selected") = vbCancel Then
txtAppDate = ""
Else
blSuccess = UpdateActualAppointmentDate("tblPatientAppointment", txtAppDate)
If blSuccess = True Then
Call SetAppointmentPosition
If mblSuccess = True Then
Call InsertMonthYear("tblPatientAppointment")
End If
Else
MsgBox "A Error occurred when saving appointment date"
End If
End If
End Sub