Default Tab Selection (revisited)

Hi All, This has been discussed before, but the suggested solution doesn’t work (or I’m doing something wrong): on the Sales Order screen there are 7 Tabs. When opening the Form, Tab number 6 gets selected. This must be Tab number 1. So I set the ActivateControlOnOpen to a Control on the first Tab - cf. the solution suggested in previous threads about this issue. However, Tab 6 still gets selected. The only reason I can think of is that on Tab number 6 is a subform (apart from the normal Sales Line subform) with a custom table. It’s not just Tab 6 getting selected when opening the Form, it’s the first field in the first row of the Subform that gets selected. Is there a solution to this one. I even tried the setting of the active control in the OnOpenForm trigger, but this doesn’t help either. Navision 2.60A W1 Native. Any help is much appreciated (the least used tab getting on your screen by default when opening an order is not what our users consider “friendly” - so they don’t see any reason to be “friendly” to me anymore…)

Try set the SaveControlInfo Property to No. That resets any user-specific control info. I hope this can help your users to become friendly again.

Hi Jens, It was already off…the SaveValues as well by the way. Like I said in my first post, I deeply suspect the subform/-table. I did some more testing this morning, and I found the following behaviour: 1. When there are records present on subform (in subtable), the ActivateControlOnOpen functions correctly and Control=10 gets selected on opening the form. 2. When there are no records present in the subform/-table, the ActivateControlOnOpen does not work, and the first column/row of the subform get selected. The subform has AutoSplitkey=YES, SaveTableView=NO, SaveControlInfo=NO. Any ideas??

Does your first tab have a control that can receive focus (cursor) on it? If not, try adding a dummy control. If that doesn’t work try this code in the onopenform trigger: CurrForm.DUMMYCONTROL.Activate; (you should name the added control “DUMMYCONTROL” for this to work)

Hi Jan-Pieter, Yes, the first Tab has a focusable control which can get selected: I use the “Sell-to Customer No.” to default to. And it works, like I said when there are records present in the subform sourcetable. No records present => no ActiveControlOnOpen performed (or overruled?) Records present => ActivateControlOnOpen performs correctly. To test my hypothesis I actually removed the subform from the Sales Order form in a testdatabase. And w/o the subform the ActivateControlOnOpen works every time.[Sigh…]

Hi All, Well, it looks like I’ve finally found the culprit, although I’m not overly comfortable with it - I can’t fully explain why the form behaves this way. Anyway, when I set DelayedInsert=YES in the subform, the main form behaves exactly as expected: the control on Tab 1 always gets selected no matter what. Setting DelayedInsert=NO immediately brings the unexpected behaviour back, depending on the existence of records in the subform sourcetable. Thanks for replying. Michiel