Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkbox selection dilema 1

Status
Not open for further replies.

stibbetts

Technical User
May 6, 2004
64
US
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?
 
Hi
You could try something like this

sub parse()
for i = 1 to N (num of checkboxes)
if checkbox & i = true then
'do stuff
else
'do different stuff
end if
end sub

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
there's my dilema, i cant use that loop becasue i only want it to reference 1 checkbox everytime the other loop runs, i know its probably bulky and there is a better way to do it and if so then how but I started using the program about a month ago and have only he help file teaching me so you might say im a novice, is there any way to select a differrent checkbox every time without giving it its own loop?

p.s. regards to the joke on your last repy, men are still wrong, atleast if they dont want to sleep with fido ;-)
 
What is the relationship between the combination repx, repy and any checkbox?

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
i am writing a file insertion program, repx represents the destination folder, repy represents the file, the checkbox is essentially the question do you want this file repy sent to this folder repx? there are several possible files and several possible folders (the number of possibilitys are endless but i have 5 files and usually between 6 and 20 folders) each file is a different drawing in inventor each folder is a different window unit (I design custom windows and doors) the file contains a spreadsheet with all of the dimension variables for the different parts that i send there, but i dont want all files in all folders hense the checkbox selection, make any sense? my checkboxes are arranged in kind of a crash course system with destination folders on the left and files across the top.
 
Let's say we have the instance where repx = 5 and repy = 7

How do those values relate to a particular check box?

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
the instance where repx=7 and repy=5 would be refering to checkbox "checkbox35" so:
if checkbox35 = true then
save file repy (just happens to be DHElevation.IPT)
to location repx (which happens to be
W:\lhwjobs\222conn\design\dwgs\c\)
end if
 
the instance where repx=7 and repy=5 would be refering to checkbox "checkbox35"
And when repx=5 and repy=7 ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
repx=7 and repy=5 would only be checkbox35 if repy=5 is the highest overall possible repy, the system counts all possible columns (repy are columns)in row 1 (repx are rows) then is goes to line 2 and continues counting ans so on, so line one would be checkboxes 1-5 then row2 would be 6-10 and so on.
does that make it a little more clear?
 
Uh?! :cool:

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Anyway, say you have n=35, doesn't matter how it was calculated, you can test the corresponding checkbox like this:
If Me("checkbox" & n).Value = True Then

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You need to assign names to your checkboxes as they are added that you can relate directly to the reality of your environment. So if they are added in ROWS & COLUMNS, then how many rows & columns? Can you define unambiguously the name...
[tt]
CheckBox & row & column
[/tt]
?

If there are more than 10/100/1000 rows or columns, then you have to build in significant places by padding with zeros, for instance.

ie if you have 11 rows and 11 columns
row1 col1 : CheckBox0101
row1 col11: CheckBox0111
row11 col1 : CheckBox1101
row11 col11: CheckBox1111

:)


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
kinda the same general idea behind it as what i am doing, its sorta working if i manually enter the checkbox name, i named them using ("checkbox" & rev) (rev is a loop counter), but i cant call for the checkboxes with the ("checkbox" & rev), an error returns. i can however call for it by typing checkbox1 or checkbox2 or ...checkboxN, anyone got any ideas for that?
 
So, which application ?(Excel, Access, ...)
which checkboxes ? (UserForm, ...)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
application is autodesk inventor, the checkboxes are in vba.userform
 
Aah. In UserForm's procedures you can use this syntax:
Me("checkbox" & i)
that evaluate to true or false.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
i hate to be a pain but the me command doesnt work and neither does the ("checkbox" & i)ive tried both about a dozen times, this versin came with inventor 5.3 does that have any bearing on the situation? i know, old, tell that to my boss though :p
thanks again
 
This syntax works for Microsoft Forms 2.0
Don't know which sort of UserForm you have with inventor 5.3, sorry.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Can you create a control array of checkboxes at runtime?
ie;

Checkbox(1)
Checkbox(2)
Checkbox(3)
.
.
.
CheckBox(n)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top