Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Redo after clicking ok on message box.

$
0
0
Using VB 2010 Express, the problem is, after displaying a message box when data is inadvertently omitted, when "O.K" is clicked, I wish to return (stay) to the current form (form5) to enter the data. The way it works now is when O.K. is clicked, the program continues on to form2 without being able to enter the data.

How can I stop the execution of the program and enter data on Form5?


VB Code:
  1. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  2.  
  3.         'Checks to make sure text box had an entry.
  4.         If Me.TextBox2.Text = "" Then
  5.             MessageBox.Show("You must enter a path and file name.")
  6.  
  7.             '**************code to stay on form5 to enter path and file in TextBox2.***************
  8.  
  9.  
  10.             '************************************************
  11.         Else
  12.         End If
  13.         Me.Hide()
  14.         Form2.Show()
  15.     End Sub

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>