Solved

Dates in VB

Posted on 1997-12-10
2
330 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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
VBS file using code from 2nd file (txt or vbs) 4 47
How to debug this code 7 65
VB6 - Convert HH:MM into Decimal 8 70
Dinamic report to Crosstab query 9 49
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

735 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