Friday, February 13, 2009

Visual Basic Show MonthEnd


Visual Basic Show MonthEnd

Version Compatibility : Visual Basic 6.0 SP6

More information : Creating a MonthEnd in Visaul Basic is not simple. You can use function
DateSerial,Year,Month,Day and You can Create is Public Function Or Private Funcation :

' Source Code Visaul Basic
Public Function MonthEnd(ByVal pDate As Variant) As Variant
On Error GoTo MonthEnd_Err
MonthEnd = (DateSerial(Year(pDate), Month(pDate), 28) + 4) - Day((DateSerial(Year(pDate), Month(pDate), 28) + 4))
MonthEnd_Exit:
Exit Function
MonthEnd_Err:
MonthEnd = (DateSerial(Year(Now), Month(Now), 28) + 4) - Day((DateSerial(Year(Now), Month(Now), 28) + 4))
Resume MonthEnd_Exit
End Function

You can creat source code in form name or copy source code to the module and cell function MonthEnd.

Example use:

' in source code form name
Call MonthEnd(Current Date)

*** if you question you can use comment please.

0 Comment:

 

programmingassist. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com