How can I prevent it from closing the form?

FranklinFranklin Member Posts: 253
Hi everybody.

I want that before closing a form, you check a number of fields and, if they are empty, the form is not closing. I can´t find the correct function because in all cases it closes.

I write the code in ONCLOSEFORM() is it right?

Comments

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Use the OnQueryCloseForm trigger.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • kapamaroukapamarou Member Posts: 1,152
    Form - OnQueryCloseForm() : Boolean
    ...
    ...
    ...
    MyConditionVar := FALSE;
    EXIT(MyConditionVar);
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    kapamarou wrote:
    MyConditionVar := FALSE;
    EXIT(MyConditionVar);
    Looks like some kind of NAV male ware... :wink:
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Franklin wrote:
    Hi everybody.

    I want that before closing a form, you check a number of fields and, if they are empty, the form is not closing. I can´t find the correct function because in all cases it closes.

    I write the code in ONCLOSEFORM() is it right?


    JUST


    ...



    DON'T




    ....




    DO





    ...





    IT!!!!!!!!

    Find another way.

    ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)
    David Singleton
  • SavatageSavatage Member Posts: 7,142
    it looks lke another job for "mandatory field" search
  • kapamaroukapamarou Member Posts: 1,152
    Looks like some kind of NAV male ware...

    Of course there would be also a
    MyConditionVar := TRUE;
    
    in the code...
  • FranklinFranklin Member Posts: 253
    jaja thx for the answers... i´ll prove it on the other trigger...

    EDIT: In that trigger is all right!!! :thumbsup:
  • SavatageSavatage Member Posts: 7,142
    Franklin wrote:
    jaja thx for the answers... i´ll prove it on the other trigger...

    EDIT: In that trigger is all right!!! :thumbsup:

    really? if you move to the next record - your fields are still blank and if you fill in that record correctly you can close the form.

    true? if so then it's not 100% effective. You want to cover all your bases and make the system work the same from everywhere therefore table validation is what you should be looking for.
    ps try to stay away from code on forms if at all possible.

    Is this for New items/customers/vendors/po's/so's, etc?????
Sign In or Register to comment.