hello - did a quick search, but didn't see anything off hand.
i have a custom list form. i have the form property Editable = No. I have some non-key fields that have OnValidate code behind them. When i launch my form, i can click the lookup on this field and select a different value. It then enters the Onvalidate logic and will take action. this is undesirable. I need to make the form completely uneditable but i am stumped. i have set the form property, the table box property, the field property all Editable = No and still i can make changes. The onvalidate of this particular field does some destructive editing, so i definitely do not want users being able to do this from the list. From the card, it is okay because the card shows a subform that displays the data that can potentially be deleted if this other field is changed. i also set the form properties allow insert/allow modify/allow delete to false and the field can still be altered.
what else can i check? In the past, setting editable = false was enough, but i cannot seem to make it work in this case.
i do have custom code in the OnLookup of this field, if that makes a difference.
the last thing i can think of is to set focusable = no so users cannot click on the field, but they may want to field filter the list, so this isn't so ideal.
kind of fell into this...
0
Answers
Try to put some code (or just some comment) in the OnAfterValidate-trigger of the field in the form. If there is some text (even a comment), the OnLookuptrigger of the table will not be triggered anymore.
Check also if there are multiple tableboxes on the form. They can be put one over another.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
yes, this is it. I have code in the OnLookup that basically launches a different lookup form based on the value of another field (like if Field A = Quote, Field B lookup will be list of quotes, if Field A = Order, Field B lookup will be list of orders).
within this look-up falls the OnValidate that is causing my problems.
i tried adding code to OnAfterValidate on the form, but it was still calling the table - OnLookup. I will play around with this idea some more. thanks for making me realize where my problem was.
edit: added a comment to Form OnLookup and that did the trick.
Actually, this is what I meant, but I wrote the other ... :oops:
If NAV finds some code in the OnLookup-trigger of the field on the form, NAV runs that code (EVEN if it is just comment) and NOT the one of the field in the table.
If NAV finds some code in the OnValidate-trigger of the form, in runs that AND the code in the table (but I don't remember the order).
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
validate: Table first, form second (from what i have seen anyhow). thanks!