Solved

Dates in VB

Posted on 1997-12-10
2
331 Views
Last Modified: 2008-02-01
My clients will enter the date of first payment.
I need to add month, week, bi-monthly, semi-monthly to this date and show on the screen. Can vb do it automaticaly or can someone help me with the code.
0
Comment
Question by:anna120297
[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 Comments
 

Accepted Solution

by:
TaoistBear earned 20 total points
ID: 1444632
Use the DateAdd function.  Intervals must be Long integers, so fractional intervals will not work properly.

Dim MyDate As Date
Dim NextWeek As Date
Dim NextMonth As Date
Dim NextBiMonthly As Date
Dim NextSemiMonthlyA As Date
Dim NextSemiMonthlyB As Date

MyDate = CDate(Text1)
NextWeek = DateAdd("w", 1, MyDate)
NextMonth = DateAdd("m", 1, MyDate)
NextBiMonthly = DateAdd("m", 2, MyDate)
NextSemiMonthlyA = DateAdd("d", 15, MyDate)
NextSemiMonthlyB = DateAdd("m", 1, MyDate)

0
 
LVL 8

Expert Comment

by:mrmick
ID: 1444633
Nice job poo!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

752 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