Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, August 28, 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: Type mismatch error when closing form
Renee Bender
Posts: 74
 
Type mismatch error when closing formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Feb 09 2:59 PM
Good afternoon! I am working with slx version 6.2.6. I have created a form that updates a custom table by clicking a Save button. I am getting the following error when I try to close the form after the table is updated. Can anyone tell me why I am getting this and how to fix it? I have the same code in my CancelButton Click sub and that works fine.
Thanks in advance for your help!
Renee

Code in error:
Account_ECCP.ModalResult = 1


Here is the error:
Type mismatch: account_ECCP at line 313 char 5
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Type mismatch error when closing formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 09 3:44 AM
You'll need to post some of the code - but I suspect a Null.
[Reply][Quote]
Renee Bender
Posts: 74
 
Re: Type mismatch error when closing formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 09 7:31 AM
Here is the sub that runs when I receive the Type mismatch error. I removed the coding from the update and insert statemens because it is quite long. It runs through the code and does the insert or update but then gives me the error when I try to set the modalresult to 1 in order to close the form.

Sub SaveButtonOnClick(Sender)
dim strVal
dim vdate
vdate = now
dim objSLXDB
dim objRS
Set objSLXDB = New SLX_DB
Set objRS = objSLXDB.GetNewRecordset
dim objCon
strVal = Application.GlobalInfo.TempAccount
Set objCon = Application.GetNewConnection
strSQL = "SELECT * FROM sysdba.Account_ECCP where AccountID = '"& strVal &"'"
objRS.Open strSQL, objSLXDB.Connection
if objrs.eof = false then
objCon.Execute ("UPDATE Account_ECCP SET myfields = formfield.text where AccountID = '"& strVal &"'")
Else
objCon.Execute("insert into Account_ECCP(tablefields) VALUES('"& strval &"', '"& Application.BasicFunctions.CurrentUserID &"', formfield.text)
end if

objrs.close

Account_ECCP.ModalResult = 1
End Sub
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Type mismatch error when closing formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 09 7:38 AM
This is not the best way to do this (Insert Into) - and you are setting MyFields with FormField.Text - but this will be null during certain opening/closing of the forms. Leading to the error on 2 counts (a) you'll want to trap for this and ensure it only fires once and (b) ensure you don't post nulls (use the CheckForNulls function and isNull etc). But, either way - you'll want to stop it running more than once and also review your code to avoid the direct insert.
[Reply][Quote]
Renee Bender
Posts: 74
 
Re: Type mismatch error when closing formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 09 7:45 AM
I'm sorry this is all very new to me. I am mostly following the way the previous developer here created his forms. If this code is called when a button is clicked on a form, how can it be running more than once? Also, where can I find out more information about the funcitons that you mentioned? Is there a good book that you can recommend that may help me?
Thanks for your guidance and help,
Renee
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Type mismatch error when closing formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 09 9:18 AM
A good book to get is DevLogix - you can get a copy from here: http://www.cafepress.com/DevLogixShop
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Type mismatch error when closing formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 09 1:00 PM
Quote:
Originally posted by Renee Bender

Else
objCon.Execute("insert into Account_ECCP(tablefields) VALUES('"& strval &"', '"& Application.BasicFunctions.CurrentUserID &"', formfield.text)


What is 'tablefields' in the above example.....set somewhere else?

Are any of the form controls databound?
[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): 8/28/2025 6:25:08 AM