How to directly move from msgbox to form1
Hi, i am having a problem on my program
Private Sub Command1_Click()
If text1.Text = "" Then
MsgBox ("You have no content on your 1st Textbox")
Else
End If
.
.
.
Bunch of codes that will result to an error if there is no value for text1.text
When the user clicks the command button and the textbox is blank, there will be a msgbox popping out.
But how can i make the program go back to the form1 without continuing the program since there would be errors after the first if statement
Re: How to directly move from msgbox to form1
Ever push F1 for Help? If you went to the word SUB and did it, you'd see the syntax of the command. (works for all of them!)
Code:
Else
Exit Sub
End If
Re: How to directly move from msgbox to form1
Quote:
Originally Posted by
dglienna
Ever push F1 for Help? If you went to the word SUB and did it, you'd see the syntax of the command. (works for all of them!)
Code:
Else
Exit Sub
End If
oh, i just used the portable version of vb 6.0 and there's no help on it.. really sorry,
uhm about the code it still has an error, so far this is what i got sir
Code:
Private Sub Command1_Click()
If text1.Text = "" Then
MsgBox ("You have no content on your 1st Transformation Matrix")
Else
Exit Sub
End If
'this is the next code after End If
text2.text= text1.text + 1
It says Run-time error '9':
Type mismatch
Re: How to directly move from msgbox to form1
Code:
Private Sub Command1_Click()
If text1.Text = "" Then
MsgBox ("You have no content on your 1st Transformation Matrix")
Exit Sub '<-- Required here
Else
'Exit Sub <--- Not required, here you can write your execution code
End If
'this is the next code after End If
text2.text= text1.text + 1 '<--- Here you may end up with wrong results
'If you are performing mathematical operation and if the value in textbox is non numeric??
'my advice is write a different Sub or function to validate the text in textbox before manipulating
Re: How to directly move from msgbox to form1
Make sure you can't put A in the box, or 1,234.00
Re: How to directly move from msgbox to form1
very good sir! now im done thanks really