Link to home
Start Free TrialLog in
Avatar of chancer74
chancer74

asked on

Can anyone tell me what mc. means?

In the line -   mc.ResetBoldDayState, can anyone tell me what the mc. means? I assume it is a reference to another variable or command in the module.
Private Sub date_Click()
Dim current_val As Date
Dim db As DAO.Database
Dim myq As DAO.Recordset
 
Set db = CurrentDb()
Set myq = db.OpenRecordset("qryDate") ' open a recordset using the results of a query
'Set tdf = db.CreateTableDef("tblMealPln_New.date")
 
If Not myq.EOF Then myq.MoveFirst 'goto the first record in the recordset (if there are any records at all)
mc.ResetBoldDayState True 'reset all dates to clear bolded states from earlier searches. Requires addition to clsMonthCal module
Do While Not myq.EOF 'do the following for the currently selected record unless there are no more records in the recordset
current_val = myq!date 'set the current_val variable to the date value of the SDate field of the current record
Do While current_val '== myq!date 'do the following as long as the current_val date is not after the Enddate field value
mc.SetBoldDayState DatePart("YYYY", current_val), DatePart("m", current_val), DatePart("d", current_val) 'make the date represented by the current_val variable bold in the calendar
'current_val = current_val + 1 'increment the date by one
Loop 'go back and repeat the process for each date up to (and including) the enddate of the currently selected record
myq.MoveNext 'once the end date of this record has been passed, move to the next record in the recordset
Loop 'go back and start the process over for each new record in the recordset
 
Dim blRet As Boolean
Dim dtStart As Date, dtEnd As Date
 
dtStart = Nz(Me.date, 0)
dtEnd = 0
 
blRet = ShowMonthCalendar(mc, dtStart, dtEnd)
End Sub

Open in new window

Avatar of azaghlool
azaghlool

Do you have a calendar object in the form?  If so, check the name of it in the properties.  It looks to be talking about a calendar object.
Avatar of chancer74

ASKER

I do have a calendar object and am trying to debug it. I just dont know what mc. means in the statement above.
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for clearing that up for me.