Sammenlignings operatorer
Hej x-perter!Er der nogen der kan gennemskue hvorfor min sub ikke vil tildele Textbox5.value en værdi, når jeg klikker på kommandoknappen?? Boksen forbliver tom.
Kan det have noget at gøre med decimaltal, da den godt vil gøre som ønsket når Textbox6.value er et hel tal.
Private Sub SpinButton1_Change()
TextBox1.Value = SpinButton1.Value
End Sub
Private Sub SpinButton2_Change()
TextBox2.Value = SpinButton2.Value
End Sub
Private Sub SpinButton3_Change()
TextBox3.Value = SpinButton3.Value
End Sub
Private Sub SpinButton4_Change()
TextBox4.Value = SpinButton4.Value
End Sub
Private Sub cmdBeregn_Click()
Const faktor1 = 0.167
TextBox6.Value = (TextBox1.Value - (TextBox1.Value * faktor1)) * TextBox4.Value
If TextBox6.Value <= 491 Then
TextBox5.Value = 1
ElseIf TextBox6.Value > 491 And TextBox6.Value <= 808 Then
TextBox5.Value = 2
ElseIf TextBox6.Value > 808 And TextBox6.Value <= 1125 Then
TextBox5.Value = 3
ElseIf TextBox6.Value > 1125 And TextBox6.Value <= 1462 Then
TextBox5.Value = 4
End If
End Sub
