Hello,
Hope you are well.
I have written code that does calculations with values in textboxes depending on If they are null or not. But for some reason I get a Type mismatch error despite the Not Null If statement being true.
Example:
If textbox 6 and 1 is empty and textbox 7 and 8 is not null it should calculate textbox 8 * textbox 7 Else the Next calculation should follow, otherwise End If. But I get an error 13 despite the above If criteria being true.
My code in red gives the error despite the If criteria in blue being true: <code><code>
If txb6Leweroorhon = "" And txb1Leweha = "" And Not IsNull(txb7Flo.Value) And Not IsNull(txb8Faktor.Value) Then
</code>
<code></code>
<code></code><code>
txb6Leweroorhon = (txb4Rywyd * 100 * txb1Leweha) / 10000
</code></code>
Can someone please assist or give advice on how to rectify this issue?
Regards,
Herman
Hope you are well.
I have written code that does calculations with values in textboxes depending on If they are null or not. But for some reason I get a Type mismatch error despite the Not Null If statement being true.
Example:
If textbox 6 and 1 is empty and textbox 7 and 8 is not null it should calculate textbox 8 * textbox 7 Else the Next calculation should follow, otherwise End If. But I get an error 13 despite the above If criteria being true.
My code in red gives the error despite the If criteria in blue being true: <code><code>
If txb6Leweroorhon = "" And txb1Leweha = "" And Not IsNull(txb7Flo.Value) And Not IsNull(txb8Faktor.Value) Then
</code>
<code></code>
<code></code><code>
txb6Leweroorhon = txb8Faktor * txb7Flo
Else
If txb6Leweroorhon = "" And Not IsNull(txb4Rywyd.Value) And Not IsNull(txb1Leweha.Value) Then
txb6Leweroorhon = (txb4Rywyd * 100 * txb1Leweha) / 10000
End If
End If
</code></code>
Can someone please assist or give advice on how to rectify this issue?
Regards,
Herman
Last edited: