hunsnowboard
10-14-2009, 01:23 AM
Hi there Everyone!
I have the following problem:
I have a userform in a document. In the userform there is one textbox and a combination list box. The choice in the combination list is free however, there is a help from the textbox. I made an if statement. If the first value of textbox is equal or bigger than 8 then the value of combination list should be “azonosito” and if the first value of the textbox less than 8 then the value of the combination list should be “szam”. If the value of the textbox is Null (which means empty, right?) than the value of the combination list should be also empty. Here is the code:
If Left(TextBox1, 1).Value >=8 Then
Comb_Box1.value = “azonosito”
Elseif Left(TextBox1, 1).Value <8 Then
Comb_Box1.value = “szam”
Elseif TextBox1.Value = Null Then
Comb_Box1.Value = “”
End If
Before I write anything in the textbox1 the value of the combination box is empty. If I write any number in the textbox1, the combination box value is working good. And here is my problem, if I delete everything in the textbox1, the value of the combination box remains “azonosito”, however it should be empty. Why is my code not working properly? What is the problem? :dunno
Thank you in advance for your help!
I have the following problem:
I have a userform in a document. In the userform there is one textbox and a combination list box. The choice in the combination list is free however, there is a help from the textbox. I made an if statement. If the first value of textbox is equal or bigger than 8 then the value of combination list should be “azonosito” and if the first value of the textbox less than 8 then the value of the combination list should be “szam”. If the value of the textbox is Null (which means empty, right?) than the value of the combination list should be also empty. Here is the code:
If Left(TextBox1, 1).Value >=8 Then
Comb_Box1.value = “azonosito”
Elseif Left(TextBox1, 1).Value <8 Then
Comb_Box1.value = “szam”
Elseif TextBox1.Value = Null Then
Comb_Box1.Value = “”
End If
Before I write anything in the textbox1 the value of the combination box is empty. If I write any number in the textbox1, the combination box value is working good. And here is my problem, if I delete everything in the textbox1, the value of the combination box remains “azonosito”, however it should be empty. Why is my code not working properly? What is the problem? :dunno
Thank you in advance for your help!