Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Check Boxes Post Reply Post New Topic
Author Message
CushingMT
Newbie
Newbie


Joined: 08 Oct 2008
Location: United States
Online Status: Offline
Posts: 8
Quote CushingMT Replybullet Topic: Check Boxes
    Posted: 02 Mar 2011 at 3:16am
I have a form that has several check boxes, each corresponding to a problem encountered in processing customer specs.  For reporting purposes, I have created code that automatically sets the count to "1", whenever a box is checked.
 
My question is regarding changing the checked box.  If a person saves a record with an incorrect box checked, they perform a search to pull up the incorrect spec.  They then uncheck the incorrect box and check the correct box. 
 
The problem is that when a previously checked box is unchecked, the count field still retains a count of "1".
 
Does anyone know how I can set the code so if a box is unchecked, the count field is reset to "0"?
 
Here is my code for setting the count to "1":
 
Private Sub Problem_Vendor_Error_BeforeUpdate(Cancel As Integer)
Me![Vendor_Count] = 1
End Sub
 
Thanks for your assistance!
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 02 Mar 2011 at 3:35am
Have not programmed much in .net, but I would assume a checkbox has its own instance variable that contains the state of the box? (ie: 1 or 0, ON or OFF, etc)

I am also assuming that the function is being called when the user clicks on the checkbox.

You can either:

1 - set the value of vendor_count = checkbox.state (or whatever the attribute is called, assuming it uses 0 and 1 to represent its state)

2 - run a if/else statement that will retrieve the checkbox's state and assign values accordingly. So if checkbox is checked, set var to 1. Else, set it to 0

Edited by Keikoku - 02 Mar 2011 at 3:37am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.