tabbing down a column in a portal
I have a table for data, one of the users would like to be able to fill in the form vertically. Is there a way to jump to the next portal row, same field with a tab or enter key?
OnObjectExit will work. The key trick is to use Exit Script [False] as the last script step to cancel out the field exit event so that the cursor stays in the designated field. It has a limitation, however, in that any user action that exits the field, such as a mouse click somewhere else in the layout will also perform the same script.
We use OnObjectKeystroke to check to see if the tab or enter key was pressed. If so, we use Go To Field to put the cursor in the correct field followed by an Exit Script step to cancel out the keystroke. This way, users can click into other fields and not have the cursor jump unexpectedly into a different field, but pressing tab or enter triggers a script that uses current data in fields to intelligently select the appropriate next field for data entry.
Depending on the design of the rest of the layotu, you might be able to set up a tab order for this. If not, you can use an onObjectExit script trigger to perform a script that puts the cursror in the desired field of the next portal row down to override the normal tab order.
Ive been trying to set up a script trigger, but the only time it seems to work is when I set it to "on object modify". Which might work if there was only oone character entered in each field. so far attempts the set it to on exit or on save don't seem to run the script.
I was thinking I might be able the set the columns as separate portals, with the same relationships but only the one field in each. that way tabbing would go down the column until you hit the last one, then go to the top of then next one set by the tab order.
Can the OnObjectKeystroke also detect the arrow keys (most of the time the data will be entered from iPads with keyboards, sometimes fom computers). That may be more intuitive for the technicians in that they could use the arrows to go to the field they want.
You can look up common keyboard character codes such as tab, return, enter and arrow keys in FileMaker help by looking up the Code function. And, of course, this is the function you can use to test to see if such non printing characters are what is being returned by Get ( TriggerKeyStroke ).
Ok so basically I can have a script that OnObjectKeystroke
If Code (Get( TriggerKeystroke) = 28, go one to the left
If Code (Get( TriggerKeystroke) = 29, go up one
If Code (Get( TriggerKeystroke) = 30, go down one
If Code (Get( TriggerKeystroke) = 31, go one to the right
with some checks to have it stop at the ends and an "else exit" so it behaves normally for other keys.
Retrieving data ...