
09-17-2002, 10:36 AM
|
|
|
|
Like this?:
last = CSng(InputBox("Insert a value", "Value insertion"))
It's still returning an error when the cancel button is pressed.
I have changed the code to this:
Private Sub Form_Load()
Text1.Text = "0"
End Sub
Private Sub Command1_Click()
Dim first As Single
Dim last As Single
Dim result As Single
If Text1.Text = "" Then
MsgBox ("sorry, try again")
End If
last = CSng(InputBox("Insert a value", "Value insertion", "0"))
first = Text1.Text
result = first + last
Label1.Caption = result
End Sub
This has cured the "type mismatch" error when the text box and input boxes are left null, but still the cancel button returns the mismatch error. I'm wondering if I'm beginning to create code that fixes code that fixes code that...
THANKS ICEPLUG!!!
BK
|
|