Is not the correct way of using the function. itVB Code:
If IsError(Text1.Text / Text2.Text) = True Then MsgBox "Error" End If
will generate a Runtime error 424. The function is suppossed to be used like...
If IsError(expression) Then...
The required expression argument must be a Variant of VarType vbError.
![]()
Why not just check for the text2.text being one character and it
being a zero. if it is a negative number that would be ok.
VB Code:
Private Sub Command1_Click() If len(text2.text)=1 and instr(1,text2.text,"0")=1 Then MsgBox "Divide by zero error" text2.text = "" Else text3.text = Text1.Text / Text2.Text End If End Sub





Reply With Quote