Calculating result from RadioButton field

1)I have 3 radiobutton fields with possible values from 1 to 10 and I want another field to show me the result of the 3 radiobuttons multiplied with eachother.

The form I use is called up as a dialogbox from my application and there is the result of the “summary” field I want to export back to my main form.

Any advice ?

Subject: Calculating result from RadioButton field

I would just put something like this is in the queryclose event of your dialogbox form:

summary := RadioFld1 * RadioFld2 * RadioFld3; (or just code this into a hidden field on your dialogbox form)

ENVIRONMENT Summary := @If(@IsError(summary); “”; @Text(summary));

Then, have your main form pull this environment variable and wipe it out when you are done using it.

Subject: RE: Calculating result from RadioButton field

Close, but as Radio Buttons are text based only, you’ll need to use @TextToNumber to change them into numerics before you multiply them.

Subject: RE: Calculating result from RadioButton field

Correct, gotta make them do some development work, can’t give them all the answers or they will never learn,

I think it was Benjamin Franklin who said you can’t learn unless you make mistakes.

Subject: Calculating result from RadioButton field

I may not totally understand what you have going here. I am reading that you have three radio buttons on a dialog box form, and that you want the result, and the result only, to be placed on your main form. If that is the case, using formula language, try this (you will have to make a couple of customizations here, as I made up formnames and such):

=================================

vform := “ThreeButtons”;

title:=“pick choices”;

@DialogBox( vform ; [AutoHorzFit] : [AutoVertFit] : [NoCancel] : [NoNewFields] : [SizeToTable] :[OkCancelAtBottom] ; title )

=================================

The form “ThreeButtons” is the form popping up as a dialogbox. It has a single cell table with three radio button fields (maybe combo boxes would work better), and another computed field outside of (below) that has the same name as the resulting field in your main form. This field calculates your number.

Finally, this field on your main form is computed, and its formula is its own name.

See if that works for you.

Regards,

  • Matt

Subject: RE: Calculating result from RadioButton field

Matt,

Can you shed some light of the accomplishments of the ‘same name’ formula. I work on a bunch of collaborative DB’s and have seen that scattered through out the environment. I haven’t touched it as I don’t want to break anything. However I am unclear as to what it actually it accomplishes. I have used @DialogBox and the DialogBox method so I am familiar with the field level data sharing you explain above. However I am looking for further clarification on what it gives back when you have a field name as the formula.

Cheers,

Shawn

Subject: RE: Calculating result from RadioButton field

Shawn,

The formula I put in had the flag [NoNewFields], so the dialogbox does not put the three radio button field values on the main formula, but if you have one field on your popup form that is the same as a field (the result field) on the main form, then the value that is calculated on the popup form will be placed on the main form…as long as the result field’s formula is its own name.

In my test, my main form had a field called Product. It was a computed field…the formula was: Product

That is all there is to it.

Let me know if you still don’t understand what I am doing.

  • Matt

Subject: RE: Calculating result from RadioButton field

Shawn,

I tried to email you at the email address you have put in your Notes.net profile, but it was returned.

  • Matt

Subject: RE: Calculating result from RadioButton field

OK, So I have a form I call using the NotesUIWorkspace.DialogBox method. It has one field on it that gathers the cost of shipping a parcel (Number Data Type called ‘fieShippingCosts’) and another field to gather the carrier you shipped it with. (Combo Box called ‘fieShipCarrier’) Neither of these fields has the field names specified in it anywhere yet my data sharing works between the parent and child form. Could this have been a requirement in an earlier version that no longer exists?

Thanks,

Shawn