Try using the "or" condition.
vb Code:
Private Sub Form_Load() 'To stop yourself from dividing by zero. If Val(Text1.Text) And Val(Text2.Text) = 0 or If Val(Text1.Text) And Val(Text2.Text) <> 0 Then cmdDivide.Enabled = False else cmdDivide.Enabled = True End If End Sub
I haven't tested the code but it should work.




Reply With Quote