Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

visual basic add 1 month to variable

Posted on 2004-04-21
4
Medium Priority
?
415 Views
Last Modified: 2006-11-17
I have a program that I need to have the next month.

meaning if today is 4/12/04

then the month is april

I need it to be may

so whatever the current month is it has to end up as May and has to be spelled out like this not 5

any ideas

this is vb6

0
Comment
Question by:hogan9111
[X]
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
  • 2
4 Comments
 
LVL 6

Expert Comment

by:MannSoft
ID: 10882015
You could use DateAdd() to add one month, and MonthName() to turn the number into a name.
0
 
LVL 20

Accepted Solution

by:
hes earned 100 total points
ID: 10882078
Try this

Dim MDate As String
MDate = "04/12/04"
MDate = DateAdd("m", 1, MDate)
MDate = Format(MDate, "m")
MDate = MonthName(MDate)
0
 

Author Comment

by:hogan9111
ID: 10882854
beautiful, thanks
0
 
LVL 20

Expert Comment

by:hes
ID: 10883179
Your Welcome, glad to be able to have helped.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

670 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