Skip to Content
avatar image
Former Member

How to Disable the SUBMIT Button using the formula.

Hi. Govindu and ohters.

I really appreciate your efforts in helping others.

I am currently working with VC 7.0. Where I am working with Validation of Data.

we have input buttons( fields) like Emp, Earea, Joining date (month & Year), Ending date((month & Year) etc.,

Here we have one submit button 'submit'.

Here what my client asks is unless and until, user fills all details then only

the submit button should be enabled. Otherwise submit button should be in disable mode.

I could be able to write formula for 'submit' button's properties( Disable) like this.

BOOL(IF(LEN(@Emp_code)0 AND LEN(@Earea)0 AND LEN(@Edept)0 AND DSUB(DVAL(@Joining_date), DVAL(@Ending_date),'D')<0 ,false,true))

Here condition is always make sure that 'Joining date' should be greater than 'Ending date' . where it is working fine for all fields except Calender Year month(Joining date & Ending date).

the calender year month format is Example : """" May 2007""""

But it is considering only month But not year.

Can you kindly provide your inputs.

Edited by: Vijay Kumar on Dec 2, 2008 10:51 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 02, 2008 at 02:36 PM

    Hi,

    In the disabled property of you submit button put in the condition for all your field as follow:

    ISNULL(var1) OR ISNULL(var2)......

    Regards,

    Murtuza

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 10, 2008 at 05:26 PM

    I think we need to set a few properties and we might just have a solution:

    First, set the Formatting for both the "From" and "To" fields to : DSTR(@Calander_Year_Month, "MON YYYY"), DSTR(@To,"MON YYYY") respectively.

    This is done in the Control Properties of both fields (simply double click their names in the right pane)

    in the Formatting Tab, choose Custom and then set the formatting expression to the above line.

    Then, create a new Expression Box of type Numeric (NUM1) and set its expression to: DSUB(@To,@Calander_Year_Month,'M')

    this too is done in the NUM1 control properties, in General Tab, enter the above line in the Expression field.

    This way you can set the validation rule to be that the value of the new numeric field NUM1 be Equal or more than 1.

    Hope this helps.

    Omer.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Solution was obtained by adding a "01/" (arbitrary day) to the date field, then using DVAL to convert the string to date, and then using the DSUB function to subtract the dates and return the difference in months.

      Regards.

      Omer.