ComponentOne True DBInput Pro 8.0
ValidateMode Property (TDBDate)

 

Reference> TDBDate Control> TDBDate Control Properties> ValidateMode Property (TDBDate)

ValidateMode Property (TDBDate)

Sets/returns the validation mode for the control during input, providing greater performance and flexibility during data entry.

Syntax

TDBDate.ValidateMode= value

Read/Write at run time and design time.

Values

Design Time

Run Time

0 - Filter (Default)

dbiValidateDateEx

1 - None

dbiValidateDate

2 - NoneEx

dbiValidateDateNone

Remarks

If set to 0-Filter, the date validation, such as leap year and non-existing dates (4/31 or 6/31), will be handled correctly. This reduces coding time and can eliminate date checking within your code. Automatic character filtering for allowable characters and field adjustments will be also made as the user enters data. For example in the case of leap years, when the input mask is set to 'yyyy/mm/dd', the user will not be able to enter the last nine in '1995/02/29'. However, if the format is set to 'dd/mm/yyyy', by inputting 29/02/1995, the control will automatically convert the 29 to 28 as the last 5 is entered. In the same way, when set the input mask to an era format such as 'g. ee/mm/dd', by entering H. 01/01/01 will invoke the control to automatically convert the date into the Syowa era as S.64/01/01.

If set to 1-None, all fields will behave independently and will not rely on any other fields. The user will be able to input a range of values (the list shown below) within a field without influencing other fields such as era, year, month or day. For example, if the format for the input mask is set to 'yyyy/mm/dd', the control allows you entering a date such as '1998/02/31' which normally can not exist as a Date type value. In the case of the era formats, the control also handles these in the same way. For example, if the input mask is set to 'g. ee / mm / dd', you will be able to enter a value such as S. 99/02/31. When entering these non-existing dates, the InvalidInput event and the error beep will not be invoked.

The following table shows the valid range for the individual fields (1-None):

Format

Valid Range

yyyy

100 - 9999

yy

00 - 99

mm

01 - 12

dd

01 - 31

ggg

Meiji - Heisei

ee

01 - 99

Similar to 1-None, if set to 2-NoneEx, all fields will also behave independent with absolutely no validation checking. The user will be able to input the full range within a field without influencing other fields. For example, if the format for the input mask is set to 'yyyy/mm/dd', the control allows you entering a date such as '0000/00/00' which surely can not exist as a Date type value. In the case of the era formats, the control also handles these in the same way. For example, if the input mask is set to 'g. ee / mm / dd', you will be able to enter a value such as S. 00/00/00. When entering these non-existing dates, the InvalidInput event and the error beep will not be invoked.

The following table shows the valid range for the individual fields (2-NoneEx):

Format

Valid Range

yyyy

100 - 9999

yy

00 - 99

mm

01 - 12

dd

01 - 31

ggg

Meiji - Heisei

ee

01 - 99

With both the 1-Validate and the 2-Validate None modes, although the control allows you to enter date values without any validation, when you move the focus away, the control will still process the data validation in accordance with any other cases. The purpose of these modes is to provide options (solutions) for those users that require smooth (free) inputting rather than the needs of data validation.

This property takes effect only when inputting within the control. After moving the focus away, the value will be validated and the events will be fired accordingly.

During input, if the entered data is incomplete such as "1998/__/01" or an invalid data such as "1998/02/31" with the ValidateMode set to 1-Validate or 2-Validate None, both the Value and the Number property will return Null. The Day, Month, Year, and EraYear properties will return a -1 and the EraName property a zero-length string.

Performing spin actions will cause values to carry on in any mode of the ValidateMode property. Note that the valid ranges for the spin actions are equivalent to when entering data as the tables shown above.

See Also

Format Property (TDBDate)

EditMode Property (TDBDate)

Value Property (TDBDate)

Number Property (TDBDate)

Day Property (TDBDateX)

Month Property (TDBDate)

Year Property (TDBDate)

EraYear Property (TDBDate)

EraName Property (TDBDate)

InvalidInput Event (TDBDate)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback