GerryGerry Posted December 17, 2004 Posted December 17, 2004 Hi, I learned yesterday (post #138056 - 12/16/04) how to test fields and then set one field "dynamically" (thank you again -Queue-, it worked like a charm). This is a related question, but I thought it would be best for it to be in a separate post... Like I said, it worked like a charm... Then I thought, "hey, this could work for another script where I also need to test fields to get the value of an specific field (by parameter)", but it didn't work. It looks like the script doesn't even "go to next field". The fields are different this time, they are calculations (even a manual "tab" doesn't go to the next field). Here's -Queue-'s code once again {with my notes}: Go to Layout [{layout with fields to be tested}] Commit Records/Requests [ ] Loop Go to Next Field If [Get(ActiveFieldName) = selectedfield] {specific parametric test here} Set Field [] {this part will be replace by Copy[] to be pasted later} Go to Layout [Original] Exit Script End If End Loop I tried including some testing script lines (to debug) and it seems that there is no "ActiveFieldName" at all... So, the question: How can we modify this code to work with "non-tab" fields. Or, can we modify calculation fields to be included in the tab-order. I hope it's clear... Any ideas? -GerryGerry
Søren Dyhr Posted December 17, 2004 Posted December 17, 2004 So, the question: How can we modify this code to work with "non-tab" fields. Or, can we modify calculation fields to be included in the tab-order. You could make a new layout, where all the needed fields exists in a taborder! But this is a quick fix, which not nessersarily is the best solution for the task at hand. If you wish us to think up other solutions to the issue, could you try to explain a little further of the field behavoiur and contents. --sd
GerryGerry Posted December 17, 2004 Author Posted December 17, 2004 Hi, These fields are part of a calendar. They are basically 42 calculation fields called square_01_value, square_02_value, etc. The calculations are based on two fields only (current_year and current_month) and of course their value is always a number (1-31) or nothing (""). I have created a special layout that will only be used by the script and the default layout order is perfect (they exist in the tab order). But in Browse mode, manually selecting the first field and pressing [Tab] has no effect whatsoever. Initially I had created 42 scripts (no parameters); one per calendar square. But I would like to make a "one-size-fits-all" script to be used with a parameter. The thing is that this script will need to check the current value of the specific square (which was specified by the parameter). By the way, the calendar works perfectly. It's just that the "42 script solution" is, by far, not the best one. I hope this is a little more clear. Thanks, -GerryGerry
-Queue- Posted December 17, 2004 Posted December 17, 2004 You can't tab into calculated fields, unfortunately. However, you can tab into auto-enter calculated fields. Can you change these fields to be auto-enter calculations?
GerryGerry Posted December 17, 2004 Author Posted December 17, 2004 Hi, Yes, I can change these fields to be auto-enter calculations. I was happy to find that FileMaker Pro "remembers" the Calculation when converting from type "calculation" to "number" once you select Auto-Enter/Calculated-Value (no need to copy/paste). I'll finish changing these field and I'll re-test the script. BRB. -GerryGerry
GerryGerry Posted December 17, 2004 Author Posted December 17, 2004 Hi, Yay! Everything works great! Very quickly, 42 scripts became just one script. Thank you once again, -GerryGerry.
Recommended Posts
This topic is 7284 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now