this is the code that causes errors:
Select Case ComboBox2.text
Case Is ="Execute Program"
'commands to select program to execute
'code brevity because i dont have the time to give full code
ListCommands.items.Add("Execute Program")
'other list box adds here like adding the time to execute the task
'use a open file dialog box to select a program to execute
ListPrograms.items.add(OpenFileDialog1.FileName)
'add code here to lock the timed event as i said i the comment above i have
code abrevity or in this line i just tell what other code would go here.
Case Is ="Auto-Type into Program"
'Other cases for other commmands here
ComboBox2.text equals the correct value i selected from combobox2 at
runtime. Example: I select ""execute program"" (for emphais so someone will
pay attention) from the combo box and it is supposed to execute a program.
But the selectedindex is correct for combo box2 when my selected index
changed event fires. for instance execute program would be first in combo
box2 so the selectedindex would be 0 for execute program. can someone help me
because this is all i know and i am not a professional programmer either and
not a beginner programmer either but i dont know everything but i know a lot
of programming tasks.
this is all i know if you know anything else i can add please tell me i have
run out of things to tell you and i think my problem could have already been
answered by now.
can anyone provide an answer it is just so fustrating programming with weird
errors like this becuase the text property shouldnt cause a error because it
should come up with a string value of a item i select out of items i add
statically and shouldnt be changed if i dont tell it to.
iam sorry but this sounds like something simple the error it gives me is:
"index out of range index is less then zero or greater then list count - 1" i
tryed what you said about checking the index to see if its correct and that
and incorrect text or blank text are not problems either so iam guessing or
thinking it is a simple problem.
thanks for any help because this is so fustrating , but i still cant figure
it out
jeffery
"Family Tree Mike" wrote:
Can you post a complete code example that fails?
"jeffman" wrote:
i do have the strings in my select case in my combo box too and the index and
text i select are correct too. i tryed using Combobox.items.item property and
selecteditem and they both caused errors for me.
"Family Tree Mike" wrote:
Using the debugger, what is the value of ComboBox2.text at the Select Case
statement? What are the values of the ComboBox2.Items list? Does the
ComboBox2.text show up in your list of cases for the Select statement?
>
>
"jeffery" wrote:
>
i need help with a combo box and this same code works on my first tab with a
combo box. The error or problem i have is this code causes an index out of
range error when i run it on my second combo box:
(errored code) Select Case ComboBox2.text
Case Is ="Execute Program"
'code to execute program here
Case Is ="Other Command that executes code at a certain time"
' code below the same as above except that it works
But not my first(this code works fine):
Select Case ComboBox.text
i tryed changeing my selected index so it would always have a zero or first
item in the index subscript and checking index properties but i still get
this error and i put my selected index in a combo box just to see if thats
not the error and it is not the index is equal to -1.
any help as to why this happens because i dont know why but every time i get
this error
thanks for any help that can be offered,
jeffery the planner