Disabling F3 dynamically

Hi, does anybody know if you can dynamically forbid the user to open a new record (by pressing F3) on a card form? I have a situation in which I don’t want the user to be able to leave the current record until he clicks some button. So far, I managed to keep the user on the current record in all situations except when he presses F3. any help will bi greatly appriciated.

Have you tried to put a control in the OnNewRecord trigger of the form? Marco

What about the LOOKUPMODE functionality. You could also set InsertAllowed to False and write code to add the record once the user does what you need them to do. Django

Pero, You should take a look at F5077 or F5097. These wizards could show you a way how to solve your problem. /Karl

Thanks for answering. I tried to put an error in the OnNewRecord trigger, but thet couses the system to close the form. I can’t set the InsertAllowed property to False, becouse in most cases the user should be able to add a new record.

quote:

What about the LOOKUPMODE functionality.

I’m not sure what you mean.

quote:

does anybody know if you can dynamically forbid the user to open a new record (by pressing F3) on a card form?
Originally posted by Pero - 2005 Jan 17 : 01:58:41

quote:

I can’t set the InsertAllowed property to False, becouse in most cases the user should be able to add a new record. -Originally posted by Pero

Maybe you can explain what exactly you are looking for?

Code on New Record, Next Record and QueryCloseForm should cover all events

Pero, For you to test: - Create a Menu Button (lets call it MB) - Create a Menu Item with ShotCutKey=F3 Now in your code, use CurrForm.MB.ENABLED := <TRUE/FALSE> where TRUE means Not allowed to use F3. Of course, you can set VISIBLE = FALSE to not display the Menu Button. BTW: Is ther a way to set ENABLED properties for Menu Items by code? Hope this helps. Jesús Soage

Sorry Pero, but VISIBLE=FALSE make the Menu Button not to work. You can set the property FOCUSABLE=No and in the OnOpenForm trigger CurrForm.MB.WIDTH := 1; CurrForm.MB.HEIGHT := 1; to hide de control in Run mode but not in design mode.

quote:

Maybe you can explain what exactly you are looking for?

This what I want: I hava to open a card form set to a specific record and let the user MODIFY the record. but the user should not be able to leave the record or insert a new one. the problem is tha this is the same form that we use for “normal” adding/editing/viewing records so I can’t set the InsertAllowed property to false. If anybody has an idea about how to solve this problem, please let me know. thanks.

You can use FILTERGROUP’s to filter the specific record you want in such a way that the user will not be able to remove this filter. The SETRECFILTER can also be of use depending on the type of filter to apply and the primary key of the table.