Expand my Community achievements bar.

How do I make a calculation work where the fields being calculated are in different subforms?

Avatar

Former Community Member
Good day,



I am working on a form that has several nested subforms. Each user radio button choice will run a different set of calculations. I've used the information from this forum to get the nested radio buttons to work however I am running into a problem where I have numeric fields in subformA that are used in subformE, etc. I am getting an error that the numeric field in subformA is "not known" or words to that effect when running this in FormCalc. I've tried several different scripts from this forum using JavaScript but all so far have just left me with an empty box.



My problem at this point is simply, How can I use numeric fields at different subform levels in my equations?



Thanks you,



Brad
8 Replies

Avatar

Level 4
Hi Brad,



You just need to sort out your addressing by the sounds of it.



Go from the root form and work your way towards it, e.g.



form1.subform1.subsubform4.textfield3.rawValue

Avatar

Level 4
Oh, and to find out if you're not sure, whilst in the script editor (cursor active in there, otherwise it doesn't work) you can hold down ctrl and shift and then click on the field in the Design View and it will give you the absolute address.



Tom

Avatar

Former Community Member
Thanks Tom,



I'll give that a try. Appreciate your time. I'll let you know what I find out.



Brad

Avatar

Former Community Member
Everything worked great. Thanks. Now I have another problem. Fixed one leak and now there's another.

Avatar

Former Community Member
How do I keep a numeric field from one button selection present to be used in another calculation from another button selection? The field is disappearing after making an additional selection. I have a grand total field that requires this field. There are 4 button selections each with their own calculation field in a subform. The grand total field requires the use of the selected button's field to complete the calculation. I think I can make the gran total calculation work using the samefilename[" + i + "] in the grand total equation. I just need to get the damn thing to stay on the form after another selection is made. I've tried using the change, exit events but maybe I am not coding this correctly. Is this clear as mud or did I explain it o.k.? I'm using Life Cycle Designer 8.2.3.1

Avatar

Former Community Member
I have no idea what you are talking about. Can you try explaining it again? What does the button have to do with the calculation other than starting it?

Avatar

Former Community Member
Sorry,



I posted a clearer question here. http://www.adobeforums.com/webx/.59b7476f/1



It's not the button I'm looking to have remain on the screen. It's what's in the subform of that button. Functionally the calculations are working but I need the subform of one of the 4 buttons the user has to selct from to remain visible after the user makes another radio button selection down the page. The last buttons the use has to select from pop up a grand total. I know it's with my code which I gave an example of in the other post. This is the basic code I am using in the calculate event of the subform. I've tried writing a switch statement, if..then, etc and tried different events but my scripting experience is only these past two months.

Avatar

Former Community Member
Rather than have you trudge around I've posted the content from my other question below:



Radio Button Script Question



didley35 - 08:37pm Dec 15, 2008 Pacific



How can I alter this script to leave the field this references visible but only when another button of my choosing is clicked on?



if(RBList.A.rawValue != 1)

{

this.presence = "hidden";

newsubform.presence = "hidden";

}



else if(RBList.A.rawValue == 1)

{

this.presence = "visible";

newsubform.presence = "hidden";

}



As it is now the field disappears when any other buttons are clicked on. I need the field to remain visible but only when a button used for a grand total field is selected. The above script is being used in the calculate event of the subform. I've tried several things but just can't seem to hit the nail on the head.



Reply To This Discussion | Back to Topic List | Bookmark | Change Subscription

To start a NEW discussion click on the Back to Topic List link and select Add Topic.

If you are in an archive forum please go up to the main topic list (archives are read only).



Messages

2 messages. Displaying 1 through 2.

First Previous Next Last Show All Messages



Thomas McConnachie - 12:45am Dec 16, 08 PST (#1 of 2)



I would wrap this radio group in another if statement looking at the second statement and an if statement in the click/change event of the second radio group diong what you want it to.



Tom

Post Reply | Bookmark back to top

didley35 - 6:43am Dec 16, 08 PST (#2 of 2)



Hi Tom,



Thank you. That is what I was thinking but my brain just isn't running at full steam. Lack of sleep and little ones plus a drop dead deadline of this Friday to have this and 5 other forms completed. Would it be too much trouble to provide a visual reference of how the code should look? I've only been doing this about 2 months and although I've been forced to learn a lot I'm still not the best of the best when it comes to scripting. I know what I want to do. I just can't put the pieces completely together yet. Thank you for your help.



Brad