i want to change the monthview1.value to be the current date
without going in and changing it everyday. i want to do it in the code. if i put in "Now" in the properties of the control itself i get an error. any suggestions
no but thanks, i tried and it does not work. when the form is opened i want the month and year to be of the current date. so i needed the value property loaded when the form is loaded but it is not letting me do this does anyone have any other suggestions.
no. the form is used in a template in microsoft word but im using vba. so when you create a new document using this template the form comes up. when it does come up i want the month and year to be current without having to go into the properties and change it everyday. when i put code in the form initialize i get an error.
All I did was start a new Work template, then added a reference to the Microsoft Monthview control to the document. I then opened the VBA editor and add the Document_New event with the code above. I then tested it by changing the date on my computer and each time I started a new document based on the template it worked fine. Am I doing something different than you are? If you choose to battle wits with the witless be prepared to lose.
run time error 35778
an error occurred in the call to the month view control
that is what i get. i use the component monthview, is there a reference under references i should be looking for
Are you actually adding the Monthview control to the document from the Controls Menu bar so that it actually appears on the document? If you choose to battle wits with the witless be prepared to lose.
In the form load event just put:
MonthView1.Value = Date
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
I assume that you've got thelatest service packs applied for the Common Controls. The MonthView control has suffered from a number of minor bugs, although I have to admit that the behaviour you describe does not sound like one of the known ones. For the record, I'd have given the same advice as foada and johnwm as the methods they describe work fine here...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.