Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Can anyone tell me what mc. means?

Posted on 2009-04-10
4
286 Views
Last Modified: 2013-11-28
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

0
Comment
Question by:chancer74
  • 2
4 Comments
 
LVL 2

Expert Comment

by:azaghlool
ID: 24117009
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.
0
 

Author Comment

by:chancer74
ID: 24117640
I do have a calendar object and am trying to debug it. I just dont know what mc. means in the statement above.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 125 total points
ID: 24125760
The ShowMonthCalendar function would define this. Assuming you're using the Lebans MonthCalendar example, then "mc" refers to the clsMonthCal object that should have been declared in the General Declarations section of your form. Here's a site that shows usage for that example:

http://www.lebans.com/monthcalendar.htm#Step%20by%20Step%20instructions%20for%20how%20to%20use%20the%20MonthCalendar%20in%20your%20own%20applications.

You can find out exactly what "mc" refers to by highlighting the phrase, then right click and choose "Definition" ... the VBA Editor should show you where that variable is declared.
0
 

Author Closing Comment

by:chancer74
ID: 31568965
Thanks for clearing that up for me.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question