View Full Version : prevent enter new for next page button of toolbar


Romy Huang
01-27-2005, 05:27 AM
I have a toolbar. there is a "next page" button on there. When it reachs the end of records, it will always add new record. How to prevent it to add new? I use topparent.restrict_enter=.T. on the "enable expn" option. Then button disable. Any help is appreciated. Thank you in advance.


01-27-2005, 07:35 AM
Here's one way.

Put the form in design mode:
-form properties
-data tab
Select modal.

The user will have to manually put the form into change or enter mode.

Slightly more involved:
In form properties select restrict enters. At this point changes are allowed but new records may not be created.

Add a button to your form to allow enters and make a new record:
topparent.restrict_enter =.f.

When the record is saved you will want to reestablish the restriction so in the form's onsave event you need
this.restrict_enter =.t.

How you approach this depends on the details of the interface you want.


Romy Huang
01-27-2005, 07:45 AM
Thank bill. I will try.
I also have "add new record" on the toolbar. I want the new record from "add new record" button. Hope I can complement that. Because my clients are DOS users, they don't know much about window. They just press "next page" button forever, add a lot of new records, but they still don't know. So I want to prevent doing that. If they want to add new record, they need to do it from "add new record" button.

Any input is appreciated. Thanks.

01-28-2005, 01:48 PM
Here is a sample. Instructions are on the single form.

Though I scripted buttons on the form the same concept could easily be applied to a custom toolbar.