Hi,
I am developing on SLX V7.2 LAN and I am trying something I presumed was going to be pretty straight forward but have become stuck.
Basically I have to text boxes linked to 2 float fields, I have a third text box in which I would like to display the total amount of the first two combined.
Initially I used the Calculated fields process from the Manage menu. I found this way worked ok but sometimes one field is null, in which case I only wish to display the value of the other, also I wish to implement a similar calculation on other fields which are currently Varchar(32). I also tried setting the text box format to 'ftInteger' and using the code as below, this only concatinated the values though.
txtTotalUpliftNew.Text = txtCPUplift.text + txtBrokerUplift.Text
I then created a sub routine to update the relevant fields on change, this method worked ok again but the fields are only updated when I press OK to close the form and I would like the result immediately.
I have attempted to using the CDbl as below, I also changed the format type to 'ftFixed' and format string to '%.2f' on the text boxes. This method appears to work exactly how I want it to apart from the fact I get the 'Type mismatch' error.
strCPUplifttxt = CDbl(txtCPUplift.Text) strBrokerUplifttxt = CDbl(txtBrokerUplift.Text) txtTotalUpliftNew.Text = (strCPUplifttxt + strBrokerUplifttxt)
Ideally I would like to use the Val function and do the calculation based on the values of the fields but SLX does not appear to recognise Val and I get an error saying that 'Val is undefined'.
If anybody has any advise it would be greatly appreciated.
Thanks
Paul |