Normal Topic FromFieldValue Question (Read 663 times)
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
FromFieldValue Question
Nov 8th, 2005 at 11:45pm
Print Post Print Post  
Page 172 on @FormFieldValue says it returns a string. if you need to use it in a mathmatic function it must be wrapped with @ToNumber or @ToMoney
I need the @ToNumber but what is wrapping?.......(insert punchline here)


Thanks for any help
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FromFieldValue Question
Reply #1 - Nov 9th, 2005 at 4:02am
Print Post Print Post  
"Wrapped" just means the string needs to be inside the parentheses like this:
@ToNumber( string )
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: FromFieldValue Question
Reply #2 - Nov 9th, 2005 at 4:11am
Print Post Print Post  
Im looking to take and put a number value from the main form to the sub form for calculation on the sub form.
FormFieldValue returns a string, what am I missing?
Thank you for your help Carl
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FromFieldValue Question
Reply #3 - Nov 9th, 2005 at 5:38am
Print Post Print Post  
If you want to SEND the number to the subform via programming in the main form, you'll want to use FormFieldValue (as opposed to @FormFieldValue).

I am using code similar to this to send a number to a money element in my subform:
FormFieldValue("MySubform", "SubformElement", 1, MainFormElement)

Based on this format:
FormFieldValue(form, field, instance, newval)

--------------------------------------------------------------------

If you want to GET the number from the main form via programming in the subform, you'll want to use @FormFieldValue "wrapped" in @ToMoney like this:
@ToMoney( @FormFieldValue("MyMainForm", "MainFormElement", 0) )

Based on this format:
@FormFieldValue(form, field, instance)

For instance, to have a calculation in the subform that uses a number from the main form, you might have something similar to this in the subform's programming:
vNumber = vNumber + @ToNumber( @FormFieldValue("MyMainForm", "MainFormElement", 0) )
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: FromFieldValue Question
Reply #4 - Nov 9th, 2005 at 5:44pm
Print Post Print Post  
Well explained.
Thank you for the Send and Get differences, and thank you for taking the time Carl
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FromFieldValue Question
Reply #5 - Nov 10th, 2005 at 12:20am
Print Post Print Post  
You're welcome. Glad I could help.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged