Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, June 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 - 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: checkbox_OnClick
Laura
Posts: 13
 
checkbox_OnClickYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Sep 07 12:47 PM
I'm trying to monitor when a user checks/unchecks a checkbox, but after security checks are done for a user to determine whether this checkbox should be enabled or not, code that I have written for the OnClick event of this checkbox is being triggered everytime the security checks are made.

I've also tried putting the code on the OnMouseUp event, but that didn't help. Is there anyway I can monitor when this checkbox is changed by a user?

I'd appreciate any help.
Thanks.
[Reply][Quote]
Ted Sturr
Posts: 78
 
Re: checkbox_OnClickYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Sep 07 6:32 PM
I am suprised you have had trouble with the OnMouseUp event. The OnClick event for the checkbox has always been problematic because it fires on the opening of the form and refreshes (not just when a user clicks). I would look at your code to see what might be happening there because the OnMouseUp or OnMouseDown event should trigger the event when the checkbox is being clicked.

Ted
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: checkbox_OnClickYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Sep 07 10:25 PM
If running 6.2.x and higher (not sure if 6.1 has it), you could do the following:

Sub CheckBox1Click(Sender)
if Not Form.IsReading then 'Replace Form for your forms Name
'Do Stuff here
End If
End Sub

By executing only if the form isn't reading, then you bypass the firing when the Form is loading or Refreshing.
Also, keep in mind that if you change the value of the checkbox itself from this event, it will fire one more time. [It doesn't go into an infinite loop], but you might have to do something like this:

Dim isTesting
isTesting = False
Sub CheckBox1Click(Sender)

if Not Form.IsReading and Not isTesting then 'Replace Form for your forms Name
isTesting = True ' This prevents the second iteration from executig your code.
'Do Stuff here
'
isTesting = False
End If
End Sub
[Reply][Quote]
Laura
Posts: 13
 
Re: checkbox_OnClickYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 07 8:21 AM
Ted,

Thank you for your input. It's not that the OnMouseUp and OnClick events are not being triggered. They are triggered when I click on the checkbox. The problem is that these are also being triggered when the form opens and when I move to another account even though I did not click on the checkbox. I need to have this triggered only when I click on it.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: checkbox_OnClickYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 07 10:45 AM
Hi Laura,

As Raul mentioned, the IsReading form property will allow you to distinguish between when the checkbox is checkbox because a user checked it or when it is set from data binding.

Sub CheckBox1Click(Sender)
If Not IsReading Then
'User clicked the checkbox
Else
'Checkbox was set from databinding
End If
End Sub


Does that make sense?

-Ryan
[Reply][Quote]
Laura
Posts: 13
 
Re: checkbox_OnClickYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 07 4:05 PM
Raul and Ryan:

I just tried your solution and it worked. Thank you so very much.

Laura
[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): 6/7/2025 1:14:21 PM