Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

VB Beginner:Problem:Combobox Item

yauchildchewyauchildchew Member Posts: 19
2 textbox; one named as T1 and the other T2
1 button named as B1
1 combobox as C1

T1 and T2 contains numbers and will produce another numeric variable (an integer), say N1.
when i click B1, it will look at the value of N1 to determine the content of the items of C1.

Say, N1 is 5, then the items in C1 will be,

0
1
2
3
4
5
>5

The program hangs whenever i tried to run this,

[code]dim k as integer
k=N1
do until k<=o
C1.items.add(k)
k=k-1
loop[/code]

To test what was wrong, I skipped the loop section and checked what would i get for N1 with the following code. So, when i click B1,

[code]C1.items.add(N1)[/code]

I tried and tested but it returned with a "NaN" in the field of C1 which represents a non-number value as indicated in msdn.

Please help! Thanks :)

Comments

  • yauchildchewyauchildchew Member Posts: 19
    well, sorry guys, i must say i am really REALLY a beginner, i forgot to initialise or assign any numerical value to T1 and T2 at the first place and thus all that troubles!!! Just noticed it a while ago :P
Sign In or Register to comment.