As you said:
Error converting data type nvarchar to int.
It seems that the "textbox27" do not contains a valid integer so it couldn't be parsed also "Else" block here is fixed to zero, so could you please try something like this:
If RadioButton1.Checked = True Then
Check out VAL