Hello everybody
I have this very simple question. Suppose the following function :
In this code, I just want the function to return a value and give control back to the calling procedure-function. But this does not occur! How do I tell the function to exit. Does the assignment of the function value need to be the last statement of the function?Code:Function ABC As Boolean Do While <condition> If <condition> Then <statements> On Error GoTo ErrorHandler <other_statements> ABC = True ' Correct master password Return ' Return End If GoTo ShuntErrorHandler ErrorHandler: MsgBox "ERROR!ï", vbCritical If Err.Number Then Resume ShuntErrorHandler End If ShuntBadErrorHandler: Loop End Function
thx, in advance
George Papadopoulos




Reply With Quote