I have a tabular form (a journal) with 30+ fields and a specific tab-order that jumps through 5 fields before jumping to a new line. This works fine. Now I need to add a column in the tab-order, but only if the user has made the column visible. First I simple added the column in the tab-order, but when the user doesn't show the colum it doesn't work. I have also tried setting the right control active in the OnDeactivate trigger, but that gives me a stack overflow error.
Simple example:
Type,No.(nextcontrol=Quantity),Description,Quantity(nextcontrol=No.)
Now I need to add a column between Description and Quantity, which (when visible) should be in the tab-order.
Any ideas on how to solve this, without making two forms?
Regards
Peter
0
Comments
What happens when you set the NextControl property and then tab when the next control is not visible? I've actually never tried. Does the cursor just disappear into the invisible column until you TAB again?
My Blog - nav.education
Peter
So you have column1 and when you tab off column1 it goes to next field...just standard.
Add an identical column, column1_2. Same field, same everything except the control number and the NextControl property.
In the OnActivate/Deactivate triggers for these columns and the one you show/hide you can make sure that the correct ones are visible. The only drawback I see is that for a moment you could have coumn1 and column1_2 both visible at the same time (until you activate and deactivate one of the fields).
My Blog - nav.education
You can put code on the form in the onafterdecativate trigger to then activate the next field you want. Sorry I can't remember exactly now. I uploaded a sample form for this some years back, but can't find it right now.
This actually sounds like a good idea! Thanks. My only problem is, that my requirements will require several dublicate fields, so it could be a bit messy. But I'll give it a try :-)
Peter
It turns out that Currform.<control>.VISIBLE doesn't change, just because a user hides a column. :^o
The user will have to close an re-open the form, to get it updated, but then it works like a charm. Thanks for your great suggestion =D>
Peter
My Blog - nav.education
I have informed the customer, that it IS possible, but will require a rather messy solution, and might cause issues for future feature requests and objects merging.
Peter