You have a couple of problem.
1. You are using go to next field. That is what filemaker is doing. You need to use go to object and the specify the name of the object you want to go to.
2. You are using the same script for both buttons with out using a script parameter. You need to use different scripts or use a script parameter so the script knows which object you want to go to.
Sorry for the delay in response, I was on vacation! I will answer in reverse order!
Here is the thing, it would be easy to use 2 scripts, if it was this small, but like I said, this is just the part of a major project with at least 40 buttons, so it would mean 40 scripts just for this operation, so separate scripts are out of question! Next thing would be to use script parameters, but I am not quite sure what are they, so any help would be mighty appreciated! I am still a bit green in FileMaker programing...
For the first answer, I was under impression that even the text fields are considered the "objects" and that setting the tab order would remedy the issue, but I was wrong, is there a way to do anything except naming the "object" in the script, being that I am trying to use the same script in multiple buttons.
You don't need 40 scripts, just the same script with a different script parameter assigned to each button. Clicking a button does not make it the active object, so get ( ActivelayoutObjectName ) won't return the object name of the button that is clicked, but the object name of the button may be passed as a script parameter to the script.
But how? :)
I tried all sorts of crazy stuff, but I wasnt sucsessful so far! I am not shure I understand that "script parameters" thing. How do You assign it, and which script or calculation read it?
Thanks for helping!
When assigning a script to a button there is a "Specify" button when "Perform Script" has been chosen. There is the list of scripts to choose from, and at the bottom there should be a place to enter an "Optional script parameter", which if you click the "Edit" button you can have the script parameter be anything.
When you want to retrieve the script parameter in a script you will want to use the function Get ( ScriptParameter ). You can put that into If statements. (Usually, I store into a veriable first, and then use that variable in the if statement and such.)
Well that solved my problem! Thank You friend, I owe You one... :)