Normal Topic Recognizing a Blank/Empty Field in a Formula (Read 680 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Recognizing a Blank/Empty Field in a Formula
May 16th, 2005 at 4:33pm
Print Post Print Post  
I have a formula that references various fields and calculates a figure, plus or minus and runs on Form Change.

However, I only want it to calculate when information is entered  into a field called commision.

The commission field is set up in a column with 12 fields labelled JANCOMM...DECCOMM. These fields remain blank until info is enetered each month.  They are all  number fields.

I tried using the following ststaement:

IF DEPT = "TC" AND @ISBLANK(JANCOMM) THEN
{
     JANADVANCES = 0.00
}

but it still calculates the JANDAVANCES.

The JANCOMM can be 0.00 in some situations.

Is there another command or Form Event that can recognize this blank/empty field.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Recognizing a Blank/Empty Field in a Formula
Reply #1 - May 16th, 2005 at 9:39pm
Print Post Print Post  
Three questions:

1.  Where is this program executed from, what field, what event?

2.  What other programming is there that could be calculating for JANCOM, and same question as above, where is it located, and what is the triggering event?

3.  Do you have a default initial value for JANCOM?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Recognizing a Blank/Empty Field in a Formula
Reply #2 - May 17th, 2005 at 4:33pm
Print Post Print Post  
In response:

1.  The programming is associated with each monthly advance field on Form change. 

Programming currently for JANADVANCES as follows:

var vJancomp as Double
var vNet as Double
var vNet1 as Double      

vJancomp = ((ANNSALARY/12) + JANCOMM + JANHOLPAY + JANVACPAY + JANBONUS + JANOTHER)
vNet = vJancomp - 7500.00
vNet1 = YRENDADVANCE

//CALCULATES ADVANCES FOR THE MONTH
//ADVANCES ONLY PROVIDED TO TC'S AND BASED ON TC EARNING $ 7,500 GROSS BEFORE LOA DEDUCTION


If  DEPT = "ADM" OR DEPT = "CC" OR DEPT = "CS" OR DEPT = "EM" OR DEPT = "MKT" OR JANCODE = "GSP - Guaranteed Supplement" or JANCODE = "GSP/SAJ - Guar Supp/Sal Adjust" OR JANCODE = "SAJ - Salary Adjustment" Then
{
     JANADVANCES = 0.00
}

ELSE


IF DEPT = "TC" AND vJancomp < 7500.00 THEN
{
     JANADVANCES = 7500.00 - vJancomp
}

ELSE

IF DEPT = "TC" AND vJancomp > 7500.00 AND YRENDADVANCE > 0.00 AND vNet > 0.00 THEN
{
     JANADVANCES = @MIN(vNet,vNet1)  * -1.00
}

ELSE

IF DEPT = "TC" AND vJancomp > 7500.00 THEN
{
     JANADVANCES = 0.00
}


2. JANCOMM...DECCOMM are a manual input fields.  The data in them are used in other various prgramming to calculate for other fields.

3. There is no default initial value for JANCOMM....DECCOMM.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged