Page 1 of 1

Allow blank value with date field

Posted: Wed Jul 20, 2011 4:00 pm
by esdaled
I have defined a date field on my page which is bound to a 6s0 numeric field with a date field formatting and a date format of '01/15/11'.

I want the field to be optional (i.e. return zeros if it blanks). The field works correctly if no keying is done in the field. However, if the user enters a date and subsequently blanks it out the field is automatically filled with '010101' when control is returned to the RPG program.

I have tried setting the "allow blanks" property to true, but this did not have any effect.

I have tried setting the "blank value" property to '0', but then an invalid date message is displayed by the screen.

Is there a way to use the date field widget and allow for a date to be cleared (i.e. set to zero)?

Re: Allow blank value with date field

Posted: Wed Aug 03, 2011 6:08 pm
by Brian
try setting the blank value property to some valid date in the distant past or future. Your program can check for this value and change it to 0 if you like once it regains control.

Re: Allow blank value with date field

Posted: Thu Aug 04, 2011 9:09 am
by esdaled
I have decided to change the field formatting to numeric with an edit word of '0 / / '. This provides the functionality that I am looking for.

However, I now have to define the bound variable as Decimal 6,0 instead of using a reference field as I had done previously. The desinger complains if an Edit word is used with a data type of "use reference field".