Solved

visual basic add 1 month to variable

Posted on 2004-04-21
4
401 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 25 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
This is about my first experience with programming Arduino.
Introduction to Processes
Starting up a Project

688 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