Solved

visual basic add 1 month to variable

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 48
ejb stateless example 2 43
Eclipse with various Java releases 7 48
CSV file copy field 1 to field 2 2 42
This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.

749 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