Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, November 30, 2024 
 
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 - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: Checkboxs
Chokri
Posts: 62
 
CheckboxsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Feb 08 11:18 AM
I am trying to pass a value to a field if there is a tick in the checkbox.


The MarketMon field is a checkbox, data type is SLX boolean
Q3 has a string datatype and is a combo box

Sub cboMarketMon(Sender)
IF cboMarketMon.Text = "T" THEN
cboq3.Text = "Yes"
cboq3.Enabled = False
END IF
End Sub

I am getting the following error message 'Microsoft VB script error type mismatch 'CboMarketMon' at line 25 char 5

line 25 char 5 in the code is 'IF cboMarketMon.Text = "T" THEN'

thanks








[Reply][Quote]
Matt Dockins
Posts: 159
 
Re: CheckboxsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Feb 08 1:20 PM
cboMarketMon is your sub name - not the name of the control the sub has no property. Your control is probably named chkMarketMon

you could probably get around this (if this sub is called from the chkbox click event) by re-writing as follows
Sub cboMarketMon(Sender)
IF SENDER.Text = "T" THEN
cboq3.Text = "Yes"
cboq3.Enabled = False
END IF
End Sub
[Reply][Quote]
RJ Eaton
Posts: 234
 
Re: CheckboxsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Feb 08 5:49 PM
the issue with checkboxes is until they are checked they are then once they are checked they are T and then unchecked they are F, you not handling the NULL in the DB value.
[Reply][Quote]
Stephen Redmond
Posts: 190
 
Re: CheckboxsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 08 1:21 AM
I think that it is safer to use chkBox.Checked

[Reply][Quote]
Chokri
Posts: 62
 
Re: CheckboxsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 08 4:56 AM
applied your suggestion and it works! thanks
[Reply][Quote]
Chokri
Posts: 62
 
Re: CheckboxsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Feb 08 6:53 AM
Hi me again - As mentioned I applied your suggested code and it worked. However if the end user clicks on the checkbox by mistake then I want them to be able to click on the checkbox to remove the 'T' value and the value in cboq3 to be removed - a sort of a toggle, any suggestions would be appreciated.
[Reply][Quote]
Matt Dockins
Posts: 159
 
Re: CheckboxsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Feb 08 8:44 AM
if (Sender.checked) then
cboq3.text = "Yes"
else
cboq3.text = "no"
end if
cboq3.enabled = not sender.checked
[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 © 2024 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): 11/30/2024 6:42:42 AM