Normal Topic ..Update fields... (Read 561 times)
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
..Update fields...
Aug 30th, 2006 at 8:44pm
Print Post Print Post  
I have two very simple problems.  I have a small range of numbers (10) that I am adding together and the sum is presented in its own field on the form.  I would like the "sum field" to represent the on-going addition of any of the numbers in that range and I would like the "sum field" to be visible but not editable by any user.

Regarding "problem 1": I have tried every "Event" available in the program editor to accomplish without success.  The sum field only populates if I tab the cursor into or out of that field.
Regarding "problem 2": I have tried making the "sum field" read only but visible...however the sum will is not visible under any other circumstance unless the field is editable and I can toggle my cursor into it...

As always...any and all help is very much appreciated.

Cliff
  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: ..Update fields...
Reply #1 - Aug 30th, 2006 at 9:16pm
Print Post Print Post  
Cliff,
One way to calculate the value of the ten elements in your Total field is to create a subroutine in Global Code that looks something like this:
Code
Select All
SubRoutine CalculateTotal()

var vTotal as double

vTotal = N2 + N3 + N4 + N5 + N6 + N7 + N8 + N9 + N10 + N11	//Where N2 through N11 are your ten elements
Total = vTotal

End Subroutine
 



Once you have created your subroutine, you can call it in the On Element Change event for each element that is totaled. For example:

N2 :: On Element Change
Code
Select All
// Run Subroutine
CalculateTotal()
 



This will also allow you to keep the Total element set to read only.

-Ben
  
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: ..Update fields...
Reply #2 - Sep 5th, 2006 at 6:39pm
Print Post Print Post  
Hi Ben:

Thank you very much for your assistance...finally had time to try this today and it works very well.

Again...much appreciated...

Cliff
  
Back to top
 
IP Logged