When trying to print a report in my vb.net project, I have some code to check whether all of the required fields have been filled in. If it isn't, a message box appears to notify the user. When they press 'OK', I need the program to stop executing the code to load the report. At the moment, it is stuck in an infinite loop, where it goes through a Try
function and a SELECT CASE
repeatedly instead.
What needs changing to stop this? I can't work out what the issue is, and why the following sections of code keep looping round one after the other
Try
Select Case checkwhat.ToUpper
Case "SUPPLIER"
If cmbSuppliers.Text.Trim = "" Then
MsgBox("Please select a supplier", MsgBoxStyle.OkOnly, "No Supplier Selected")
Return False
Exit Try
End If
Case "RB6B"
check("SUPPLIER")
If check("SUPPLIER") = True Then Else Exit Sub
createWorkTable("SUPPLIERS-TERRITORY-LS")
regReport("rTerritoryWTableCrosstabB.rpt", "", con, Me.MdiParent, cReport, True)
fillPms(cReport, "Sales by Territory by Supplier", "For " & cmbSuppliers.Text.Trim, "", "AOT02")