Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, July 7, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Sum data and display in textbox.
Renee Bender
Posts: 74
 
Sum data and display in textbox.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 May 10 3:25 PM
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. Can anyone tell me what I am doing wrong?
Thanks!

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
[Reply][Quote]
Karlin High
Posts: 9
 
Re: Sum data and display in textbox.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 May 10 3:25 PM
Have you tried something like MsgBox(objRS(0).Value) just before the error-causing line, to see what's actually in the recordset?
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Sum data and display in textbox.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 10 8:25 PM
RS data coming in is invariably/usually string, always cast locally. Always cast prior to use in an if statement. Have NEVER used your .Item property...

Mycurr = ccur(rs.fields(0).value)
if mycurr > 0
is a start

but even that doesn't trap mulls
[Reply][Quote]
Renee Bender
Posts: 74
 
Re: Sum data and display in textbox.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 May 10 7:15 AM
Thanks for your suggestions. I actually was able to get it to work by changing the FormatType of the textbox to ftCurrency.
Renee
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/7/2025 8:32:03 PM