So I have a load action that automatically refreshes the page during a successful save (via the Save_Button.Click)
The issue is that when the user clicks the save button I need to check to make sure a certain field was populated. When this happens and I exit the sub, the page refreshes and removes all of the users selections. I want to still have my check put in, but I want to abandon the user save button click if possible.
I am thinking there is something else I can put in other than the Exit Sub. Something that will not cause the Load to occur again, but I am stumped.
Code:
Private Sub Main_Add_Load(sender As Object, e As EventArgs) Handles MyBase.Load, Save_Button.Click
The issue is that when the user clicks the save button I need to check to make sure a certain field was populated. When this happens and I exit the sub, the page refreshes and removes all of the users selections. I want to still have my check put in, but I want to abandon the user save button click if possible.
Code:
If PosType_CB.Text = "" Then
MsgBox("You Must Select a User Type", MsgBoxStyle.Exclamation, "Select a User Type")
Exit Sub
End If
I am thinking there is something else I can put in other than the Exit Sub. Something that will not cause the Load to occur again, but I am stumped.