473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

MonthName Help Example Problem

Bob
I cut and pasted the following from the HELP into the form load event of a
new form and I get an error stating that MonthName is a namespace and can not
be used as shown. What's wrong?

Dim MyMonth As Integer
Dim Name As String
MyMonth = 4
Name = MonthName(MyMonth, True) ' "True" returns an abbreviated name.
MsgBox(Name) ' Name contains "Apr".

Nov 21 '05 #1
4 1343
"Bob" <Bo*@discussions.microsoft.com> schrieb:
I cut and pasted the following from the HELP into the form load event of a
new form and I get an error stating that MonthName is a namespace and can
not
be used as shown. What's wrong?

Dim MyMonth As Integer
Dim Name As String
MyMonth = 4
Name = MonthName(MyMonth, True) ' "True" returns an abbreviated
name.
MsgBox(Name) ' Name contains "Apr".


Qualify the function's name with the module containing it
('DateAndTime.MonthName').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
i think you have the problem in another place... i try the code and works
just fine!

"Bob" wrote:
I cut and pasted the following from the HELP into the form load event of a
new form and I get an error stating that MonthName is a namespace and can not
be used as shown. What's wrong?

Dim MyMonth As Integer
Dim Name As String
MyMonth = 4
Name = MonthName(MyMonth, True) ' "True" returns an abbreviated name.
MsgBox(Name) ' Name contains "Apr".

Nov 21 '05 #3
Bob
I found out what the probelm was. When I created the project I named it
MonthName instead of MonthNameDemo. SO the project name and the function were
named the same.

"Herfried K. Wagner [MVP]" wrote:
"Bob" <Bo*@discussions.microsoft.com> schrieb:
I cut and pasted the following from the HELP into the form load event of a
new form and I get an error stating that MonthName is a namespace and can
not
be used as shown. What's wrong?

Dim MyMonth As Integer
Dim Name As String
MyMonth = 4
Name = MonthName(MyMonth, True) ' "True" returns an abbreviated
name.
MsgBox(Name) ' Name contains "Apr".


Qualify the function's name with the module containing it
('DateAndTime.MonthName').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
"Bob" <Bo*@discussions.microsoft.com> schrieb:
I found out what the probelm was. When I created the project I named it
MonthName instead of MonthNameDemo. SO the project name and the function
were
named the same.


ACK. By default the project's root namespace has the name of the project.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
1
by: Bo Xu | last post by:
Object of Combination By Bo Xu Introduction A combination of n things, taken s at a time, often referred as an s-combination out of n, is a way to select a subset of size s from a given set of...
1
by: Wharfrat | last post by:
Hey all, I have a query that pulls data based on the month. I'm using MONTHNAME(CURDATE()) to get the current month. I need to get the previous month. Is there a way to do this using MONTHNAME?...
25
by: Xah Lee | last post by:
Python Doc Problem Example: gzip Xah Lee, 20050831 Today i need to use Python to compress/decompress gzip files. Since i've read the official Python tutorial 8 months ago, have spent 30...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
4
by: Abraham Andres Luna | last post by:
how can i use the DateAndTime module in my csharp code i included a using statement: using Microsoft.VisualBasic; and then called the function: DateAndTime.MonthName(1);
1
by: gerry | last post by:
I wrote up a couple of simple SiteMap providers based on the MSDN documentation and examples, in particular the AccessSiteMapProvider example found at...
2
by: veaux | last post by:
I have single integers representing a month (i.e. 2) and need to convert this to (March 1, 2007). So "2" represents really the end of the previous month. I'm using MonthName and adding 1 in my...
1
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
I have an VC++ MFC Win32 application that isn't working correctly when I build it with VS2005. The problem seems to be in some ADO ActiveX controls that came with VS6 and are now out of support....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.