Iv just started learning vb in uni its not important i get this done now i can wait til next weeks lecture but i wanna mess around with some other stuff and its confusing me why this code isnt working.
this code works fine
Code:
sub btnkelv_onclick()
If txtkelv.value < 0 Then
fah.innertext = "Invalid"
cels.innertext = "Invalid"
Kelv.innertext = "Invalid"
Else
fah.innertext=txtkelv.value-273.15
cels.innertext=(((txtkelv.value-273.15)*9)/5)+32
kelv.innertext=txtkelv.value
end if
end sub
which basically is a calcualtor converting each temperature into different values but like i said this works perfect while this which is nearly identical code does not
Quote:
sub btncels_onclick()
If txtcels.value < -273.15 Then
fah.innertext = "Invalid"
cels.innertext = "Invalid"
Kelv.innertext = "Invalid"
Else
cels.innertext=((txtcels.value*9)/5)+32
kelv.innertext=txtcels.value+273.15
fah.innertext=txtcels.value
end if
end sub
iv bolded the part that does not seem to work. i am simply trying to set a flaw value which it cannot go below as it does not exist.
_________________
I am not online much if you wish to get hold of me send me a private message with your email/discord and ill catch up with you.