How do I write code in SalesLogix to sum revenue data and populate a textbox???

Question:

I am trying to run a query that will sum some revenue data and then just have the sum populate a textbox. I keep getting an error of Type Mismatch in Saleslogix. I am currently running 7.5.1.

Here is the code that I am using:

strSQL = “Select SUM(Revenues) TotalRevenue from sysdba.ACCOUNT_REVENUE where ACCOUNTID = ‘”& strVal &”‘ AND FISCALYEAR = ‘”& strYear &”‘”

objRS.Open strSQL, objSLXDB.Connection

if objrs.eof = false then
If objRS.Fields.Item(“TotalRevenue”).Value > 0 then ——- This is where the system is giving me the error message. 
txtTotalRevenue.Text = objRS.fields.item(“TotalRevenue”).Value
else
txtTotalRevenue.Text = “0.00”
end if
end if

 

Answer:

Change the FormatType of the textbox to ftCurrency.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!