[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

visual basic add 1 month to variable

Posted on 2004-04-21
4
Medium Priority
?
421 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
  • 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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
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 …
Loops Section Overview

612 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