MagicPer 2.0
By: Januar Kwee Date: 19/07/2000
File:

magicper.zip

Size:

50.1 KB

Download now!

During the development of a program, we often need to ask user to input a period (not a date, just month and year or even year only) of process or reports; instead of using a MaskEditBox and a lot of coding, just put MagicPer in your form and let it do all for you.

acx024a.gif (1540 byte)
This is how the MagicPer control looks like

Property Desription
Period Set/get string period with format "yyyymm".
EndDate Return the last day of the period (month or year) in Date type.
EndMDY Same as EndDate, but return type is String with "mm/dd/yyyy" format.
Useful when using with SQL Statement.
StartDate Return the first day of the period (month or year) in Date type.
StartMDY Same as StartDate, but return type is String with "mm/dd/yyyy" format.
Useful when using with SQL Statement.
SQLRange Return (String) range date of beginning and end of current period.
This is useful when using one period and put it in SQL statement.
The return value is #mm/dd/yyyy# and #mm/dd/yyyy#.
Month Return in Integer Month of current period.
Year Return in Integer Year of current period.
Mode Integer value defining the mode of MagicPer:
0 - month and year
1 - year only

Example

This example creates a simple SQL query using the range of dates returned by the MagicPer control.

strSQLquery = "SELECT * FROM tbHeaderPO WHERE [PO Date] between " _
& MagicPer1.RangeSQL

MagicPer1 is the name of the MagicPer control.

To install, extract the file from the ZIP archive into a temporary folder, and then copy all the file of the ocx subfolder into the C:\Windows\System folder. In VB, go to Project>Components, click Browse, go to C:\Windows\System and select the file MIperiod2. The control should then be available from your toolbox. Remember that it is not visible at runtime.
In the installed folder, you can find a readme file and the complete source code for the control.

Click Here!


Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
To contact the Webmaster, click here.
Hosted by InWind: www.inwind.it