Solved

VB6 checkbox(5) recursive calls

Posted on 2006-10-20
2
250 Views
Last Modified: 2013-12-25
Hi:
I am working with VB6 and a checkbox array with 6 elements. The functionality I need is this:
When  user ckicks on checkbox(3) I want checkbox(4) and checkbox(5) = CHECKED
and
checkbox(0)checkbox(1)checkbox(2)=Unchecked.

When I wrote the code it was the chckbox_Click event gets into recursive events.
How can I accomplish the above results. Simple question please help me with sample code.
dhamijap
0
Comment
Question by:dhamijap
2 Comments
 
LVL 20

Accepted Solution

by:
hes earned 50 total points
ID: 17775001
Try this:

Private Sub chckbox_Click(Index As Integer)
   Static bBusy As Boolean ' to stop recurrision
   Dim iCnt As Integer
   Dim iIndex As Integer
   If bBusy Then
      Exit Sub
   End If

   iIndex = Index
   For iCnt = iIndex To chckbox.UBound Step 1
      bBusy = True
      chckbox(iCnt).Value = 1
      bBusy = False
   Next iCnt

   For iCnt = iIndex - 1 To chckbox.lBound Step -1
      bBusy = True
      chckbox(iCnt).Value = 0
      bBusy = False
   Next iCnt
End Sub
0
 

Author Comment

by:dhamijap
ID: 17775062
hes:
works perfect. Thanks.
dhamijap
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now