I need a bit of help in preventing division by zero in my calculator.
Here's the code I currently have:
I'm just not sure in how to combine the values of Text1 and Text2 together.Code:Private Sub Form_Load() 'To stop yourself from dividing by zero. If Val(Text1.Text) And Val(Text2.Text) = 0 Then cmdDivide.Enabled = False If Val(Text1.Text) And Val(Text2.Text) <> 0 Then cmdDivide.Enabled = True End If End Sub






Reply With Quote