Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name of Current Field Problem.

Status
Not open for further replies.

rifter1

Technical User
Jun 1, 2006
37
0
0
US
Using FMP7

I have an incredibly large table of data that I need to visually look at and select the right data to enter into field. Unfortunately there are about 25 fields that require this lookup.

This is what I want to do:

I click on the field that I want to enter data into. FMP Switches to another layout which has a lot of data in rows and columns. I click on the right field, FMP copies that data, returns me to the original layout and pastes it into the field.

This seems like a really simple thing.

BUT I can't find a way to return the data to the original field. Is there a way to remember which field I clicked on in the original layout?

I found on FileMaker's website in FMPro version 3.0 you could do this. It seems strange they REMOVED a powerful feature like that?
 
Most of the concept does work. ie: I have a script that goes this:

Go to Layout [datalayout]
Pause/Resume Script [indefinitely]

(all fields in other layout are defined as a button which simply Resumes the script)

Copy [Select]
Go to Layout [original layout]
Paste [Select]

Only problem is it doesn't paste because no fields are selected. I need to know how to select the original field.
Even if I could store the name of that original field in a global field temporarily, but I can't seem to find a way to determine the field's name. There are so many, is the only option to create loads of scripts, one custom one per each field that I need to click on?
 
In other words, the answer I don't want, is Changing that last line to read:

Paste [Select; nameoffield]

Since there are so many individual scripts I'd have to create then.
 
Try opening a new window, then go to your layout. Copy then close the window and you will still be in your original field.


Hope that helps
 
Yes that did help a lot, but now I have the issue that a field, once defined as a button, when you click on it, it does not actually select the field or put the cursor into it. So the paste still does not work.
 
It seems to me that there probably is a more conventional method of reaching your goal. Are you open at all to other possible methods?

I personally try to avoid using copy and paste in scripts. I find the SET FIELD method to be more conventional as it doesn't involve the clipboard at all.

If you were to explain WHAT it is you are trying to accomplish rather than HOW someone here may be able to suggest a simple alternative.

-Striker
 
Sure.

My ultimate goal is to have a load calculation database for HVAC sizing on a handheld.

Each city that I go to has its own large table of numbers which represent heat gain through different types of materials. Tables for various windows, doors, walls, ceilings, floors, etc. Each of those construction items has about 40 possible numbers that I can choose from, depending on what construction the home is built from.

So for instance, on my Worksheet, I go to the "Windows" area. I select "New Window". It takes me to a new layout and creates a Window. Now I have to enter the heat gain coefficient for that particular window. Well, there are a lot of possibilities. Is the window single, double, or tripe pane? Which direction is it facing? N, E, S, W, etc, and does it have any shade?

Each of those extended possibilities exists for each window. So right now, I consult my actual page of paper for what City I am in, then look up the windows, then which direction it's facing, then if it has 1, 2 or 3 panes of glass, then if it has shade. I select THAT number, and put it on my original worksheet. That number gets multiplied by the square footage of that window.

Then I move on to the next one.

It would be easiest if I could bring up my City grid of numbers, just click, on the one I want, and it automatically be put into the proper field for that window, which of course then will be automatically multiplied by the square footage.

Keep in mind there is a lot more data than just for windows. After all the window I move on to doors, square footage of outside walls, type of roof... lots more.

In the end, all the totals are added up so you can determine the heat gain on any given house.

But all I really want is
(a) click on a field in my calculation worksheet to bring up the large table of data
(b) click on the number I want
(c) have that number automatically entered in the field I originally clicked on in the worksheet

Does that makes sense?
 
My original concept for a solution is as follows:

(a) click on field in worksheet.
(b) script gets Name of this field and stores it temporarily
(c) switch to other worksheet and get data
(d) switch back and Set Field [stored field name, data]

BUT you can't seem to get a field name. You could in older versions, and on a web form you can get active field, but somehow this option is no longer in FMP7?
 
YIKES! I'm sorry I asked. [grin]

This sounds complicated. I'll have to noodle on this for a while. If anyone else has ideas feel free to lend-a-hand.

-Striker
 
Well I han handle all the code and make it all work no problem, it's simply the user interface.

It sounds simple, one click to select a field and open up another window with a data table in it, and another click to select a number and have it pasted in the first field I clicked on.

How hard can that be. )


Well, there IS a way to do it, but it involves a lot of scripts, one custom script per field I click on. That way I can target the return field with a Paste [fieldname, data] type command.

It's just not...

Elegant.


And it is a lot more work.
 
I didn-t went in dept, but at first sight I would say there is a 'concept error'.

>> I click on the field that I want to enter data into. FMP Switches to another layout which has a lot of data in rows and columns. I click on the right field, FMP copies that data, returns me to the original layout and pastes it into the field.<<

The moment I see copy, switch, paste I think 'set field'.

With your 2 jun post, it looks as you could use a filtered found set.
In one layout/table you make your choice: window, panes, direction etc.
With a compound key you can filter down/narrow the needed information. Once you are at the end of the choice list, the relationship will have the one and only possibility for you item. This value can be transfered to your end field with set field.

But we need much more information about the data and how the different tables are setup to be sure.

Still, with opening another window, better would be to use a scripted set field movement in stead of copy/paste.

You're talking also about worksheet, this sounds like spreadsheet stuff to me. I suppose you're talking about a layout or a form.
Then you're talking about a 'fieldname'.
Do you really mean the fieldname or is it the 'data' in a field 'named'.....

If you really want the 'fieldname', there is a function for that, but I can't see nor understand the why of the fieldname. So, I assume you want the 'data' out of a field.

If you could provide more information how the different tables are populated and with what, how your relationships are now, we could help you...

It can seems to you only a user interface problem, but I think the basic of that problem is the structure of your application.
For now, I'm sitting next to Striker....
 

Oh sure I can filter things down by various means.

Yes I can pick all these criteria, one at a time, clicking away, entering information, selecting things... to bring it down to the one I need.

Here is the flaw in that:

On a handheld, I want this EASY and Fast.

The method you propose was the first one I thought of, and well it's entirely cumbersome and takes a Long time.

The method I want to make happen is quick. That's what I'm after.
 
If I understand your way of working for f.i. a window in a given area with specific properties, you look this up on a 'paper' list untill you find a number that represents all the properties. (your jun 2 post)
This number you key in into the database ?

Sorry, but I still try to get a hold on the purpose and the way of working and to have a picture of the structure of your database.

If you want just to pass a value from 1 field in a table to another one in a given table, I suggest to make all the fields from the list a button.
Click on a field in the first table/layout and park this field in a global, switch to a given layout (with scriptparamater) and open the right window, click on the needed field in the list, park the data in another global, close the window and set the field (scriptparameter to first gobal)) to the looked up value in the second global. Empty the globals and you're ready for the next lookup.

Or I'm missing something....
 
Yes that's the way it works now..
In my main worksheet I select the City I'm in.
This brings up a bunch of default peramerters for that city. ie: design outdoor temperature (the temperature that 99% of the days for that city fall below) In Phoenix that's 108 degrees. This data also pertains to the latitude of the city, which affects sun exposure. The farther north you are the less heat there is. Etc.

I pick "new window"
I input the compass direction
I input the square footage
I select type of glass
I select how many panes of glass
I select various parameters for shade on the glass
ie: insect screen, sun screens, large shade trees...
There are complex calculations for shade. Some windows have overhangs. Based on average yearly shade lines, a portion of that window will have a reduced heat tranfer when averaged across the year. That is taken into account. But you have to input various measurements for the overhang and the window.


THEN...
From these critera the database has a number which represents how much heat will transfer through 1 square foot that type of window in that city (given it's average yearly sun, latitude, etc etc)

Then that's multiplied by the square footage of that window.


SO...
Rather than input So much stuff, why not just have a large pop-up grid that you can visually select the right number.

You know what though, FMP7 doesn't seem to have a way to do that. I can't click on the empty field, have this grid pop up, click on the value I want, have the grid go away, and enter that number into the original field.

Sounds too simple.

That's the difference between the logic of a programmer and the logic of an end-user. Since I'm familiar with FMP I'm using it. But it seems to be forcing me to do things the cumbersome way.


 
I have to digest this for a while.
Seems to me a great application !!!

To come back to your first question:

>>BUT I can't find a way to return the data to the original field. Is there a way to remember which field I clicked on in the original layout?

In FM 7/8 you have the function:
Get(ActiveFieldName) function
The name of the field currently containing the cursor.

If you could 'park' this in a global or a repeater and use it as a 'return' parameter....the place (goto field - parameter)

And I'm intrigued by your final number (and not only that). Can you 'work back' from this number to each single item you checked in the different lists?
Or is this a given list of parameters to make the calculation 'on the way' down the list. This way you have to imput all the creteria in a given fix order, or not ?

I got the final outcome, it is the result of a complex calculation 'along the way' through your 'checklist'.
But 'the number in your 'grid', I still don't understand what this 'number' represents.


Sorry for all these questions, but as a programmer I indeed try to find the logic, and not able to 'see' your application....
 
Get Active Field" only works on Web-based applications. That's what I read in the help menu system
 
OK as a Programmer, here is the LONG way, which I think you will appreciate.


It's not the way I wanted, but perhaps it's the right way.
You see the amount of tables and variables necessary to do the "Windows" the correct way.

Select a city (this affects all other variables), then click on "Windows" then select your window types, keep adding windows to your heart's content.

Keep in mind, North facing windows are not affected by OVERHANGS. Since there is no shade on a North window.

I think I will stick with this method now that I've done it. Thanks for the posts, all.
 
By the WAY...
I can't seem to find a way to remove the setting of the city in the "Windows" tab.

Once I set the city in the main tab "Worksheet" I don't want to set it again. How can I make the city a global setting across all the tables?
 
Your app is sure a beauty. Congrats.
Don-t leave the link too long live....

I took your first post to see what you want to accomplish, but need some guidance here.

Could you repost your first question, but with field/layout/table names this time so I can 'follow'¿
 
Sorry, I saw your second post.(same goes there for the link)

Will take a look at it tomorrow, to see if I can find my way. I don't promise anything now. I have to study your 'behind the screens' first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top