cycling through checkboxes

cycling through checkboxes

Anonymous
Not applicable
685 Views
13 Replies
Message 1 of 14

cycling through checkboxes

Anonymous
Not applicable
so, this program that i am writing is coming into the home stretch, my problem is that i cant get it to cycle through checkboxes. i have created checkboxes at runtime and names them, big supprise, checkbox1, checkbox2, checkbox3,...checkbox-N. i have a loop inside a loop that determines what each checkbox references, i cant get the checkboxes to cycle though, the loop gos something like this:

public sub parse()

do while repx < (integer variable)
repy = 0
do while repy < (integer variable)
if checkbox = true then ' this is where the checkbox's need to cycle
' do the required operations
repy=repy+1
loop
repx=repx+1
loop
msgbox "operation complete"
end sub

sorry if some syntax arent quite right but i hope you get the general idea. there is one checkbox for each combination of rex and repy meaning there are (repx * repy) boxes named in order 1 through N. anyone know how to cycle through those boxes?
0 Likes
686 Views
13 Replies
Replies (13)
Message 2 of 14

Anonymous
Not applicable
VB or VBA? If VB then make them a control array and refer to them as for i=1 to foo checkbox(i) does something here next i VBA does not have control arrays however. -- Sean Dotson, PE Autodesk Inventor Certified Expert http://www.sdotson.com http://www.sdotson.com/forums/ Check the Inventor FAQ for most common questions www.sdotson.com/faq.html ----------------------------------------------------------------------- "stibbetts" wrote in message news:2149285.1083851415113.JavaMail.jive@jiveforum1.autodesk.com... > so, this program that i am writing is coming into the home stretch, my problem is that i cant get it to cycle through checkboxes. i have created checkboxes at runtime and names them, big supprise, checkbox1, checkbox2, checkbox3,...checkbox-N. i have a loop inside a loop that determines what each checkbox references, i cant get the checkboxes to cycle though, the loop gos something like this: > > public sub parse() > > do while repx < (integer variable) > repy = 0 > do while repy < (integer variable) > if checkbox = true then ' this is where the checkbox's need to cycle > ' do the required operations > repy=repy+1 > loop > repx=repx+1 > loop > msgbox "operation complete" > end sub > > sorry if some syntax arent quite right but i hope you get the general idea. there is one checkbox for each combination of rex and repy meaning there are (repx * repy) boxes named in order 1 through N. anyone know how to cycle through those boxes?
0 Likes
Message 3 of 14

Anonymous
Not applicable
VBA, thanks for the try though 😕
0 Likes
Message 4 of 14

Anonymous
Not applicable
You could do something like this though Private Sub CheckMe() Dim chk(2) As Object Set chk(1) = Me.CheckBox1 Set chk(2) = Me.CheckBox2 Dim i As Integer For i = 1 To 2 chk(i).Value = 1 Next End Sub -- Kent Keller Autodesk Discussion Forum Facilitator "Sean Dotson" wrote in message news:409a4b46_2@newsprd01... > VB or VBA? > > If VB then make them a control array and refer to them as > > for i=1 to foo > checkbox(i) does something here > next i > > VBA does not have control arrays however.
0 Likes
Message 5 of 14

Anonymous
Not applicable
no dice 😕
0 Likes
Message 6 of 14

Anonymous
Not applicable
I don't understand what you are saying. What is no dice? It worked fine here in VBA. -- Kent Keller Autodesk Discussion Forum Facilitator "stibbetts" wrote in message news:33484993.1083866064526.JavaMail.jive@jiveforum1.autodesk.com... > no dice 😕
0 Likes
Message 7 of 14

Anonymous
Not applicable
doesnt work here, i must have something wrong. i have however gotten it almost working another way. the only problem is that it wont reference checkbox & x where x=4 i have to manually enter 4, anyone know how to make it work off from that variable?
0 Likes
Message 8 of 14

Anonymous
Not applicable
You need to post your code so we can see what you are doing... -- Sean Dotson, PE Autodesk Inventor Certified Expert http://www.sdotson.com http://www.sdotson.com/forums/ Check the Inventor FAQ for most common questions http://tinyurl.com/2mk45 ----------------------------------------------------------------------- "stibbetts" wrote in message news:20977948.1083872577871.JavaMail.jive@jiveforum1.autodesk.com... > doesnt work here, i must have something wrong. i have however gotten it almost working another way. the only problem is that it wont reference checkbox & x where x=4 i have to manually enter 4, anyone know how to make it work off from that variable?
0 Likes
Message 9 of 14

Anonymous
Not applicable
i give up on that, can anyone tell me about arrays? for example how to build one and/or how they work
0 Likes
Message 10 of 14

Anonymous
Not applicable
You can only have arrays in VB not VBA. As I said before post your code and we'll have a look. -- Sean Dotson, PE http://www.sdotson.com Check the Inventor FAQ for most common questions www.sdotson.com/faq.html ---------------------------------------------------------------------------- ------ "stibbetts" wrote in message news:21538900.1083941135931.JavaMail.jive@jiveforum1.autodesk.com... > i give up on that, can anyone tell me about arrays? for example how to build one and/or how they work
0 Likes
Message 11 of 14

Anonymous
Not applicable
i appreciate all the help, a gentleman in another forum gave me a sub to do this for me. he's my hero 0:-)
0 Likes
Message 12 of 14

Anonymous
Not applicable
-- Sean Dotson, PE http://www.sdotson.com Check the Inventor FAQ for most common questions www.sdotson.com/faq.html ---------------------------------------------------------------------------- ------ "stibbetts" wrote in message news:26420409.1083943382459.JavaMail.jive@jiveforum1.autodesk.com... > i appreciate all the help, a gentleman in another forum gave me a sub to do this for me. he's my hero 0:-)
0 Likes
Message 13 of 14

Anonymous
Not applicable
LOL Getting headaches Sean? "Sean Dotson" wrote in message news:409c01cb$1_1@newsprd01... > > > -- > Sean Dotson, PE > http://www.sdotson.com > Check the Inventor FAQ for most common questions > www.sdotson.com/faq.html > -------------------------------------------------------------------------- -- > ------ > "stibbetts" wrote in message > news:26420409.1083943382459.JavaMail.jive@jiveforum1.autodesk.com... > > i appreciate all the help, a gentleman in another forum gave me a sub to > do this for me. he's my hero 0:-) > >
0 Likes
Message 14 of 14

Anonymous
Not applicable
Chest pains.. -- Sean Dotson, PE Autodesk Inventor Certified Expert http://www.sdotson.com http://www.sdotson.com/forums/ Check the Inventor FAQ for most common questions http://tinyurl.com/2mk45 ----------------------------------------------------------------------- "Teun Ham" wrote in message news:409f257f$1_3@newsprd01... > LOL > > Getting headaches Sean? > > "Sean Dotson" wrote in message > news:409c01cb$1_1@newsprd01... > > > > > > -- > > Sean Dotson, PE > > http://www.sdotson.com > > Check the Inventor FAQ for most common questions > > www.sdotson.com/faq.html > > -------------------------------------------------------------------------- > -- > > ------ > > "stibbetts" wrote in message > > news:26420409.1083943382459.JavaMail.jive@jiveforum1.autodesk.com... > > > i appreciate all the help, a gentleman in another forum gave me a sub to > > do this for me. he's my hero 0:-) > > > > > >
0 Likes