Dump the goto:
dim Success as Boolean
do
success = true
try
for each f as form in my.application.openforms
if f.name <"Form1" then f.close
next f
catch ex as exception
success = false
end try
loop until success
With structured exception handling, Goto should generate a compiler warning
"Warning: Speghetti Code using Goto". Since you can jump an arbritrary
number of levels up via try ... catch blocks, there is no longer any need in
the VB language for Goto.
Mike Ober.
"Kevin Yu [MSFT]" <v-****@online.microsoft.comwrote in message
news:N8**************@TK2MSFTNGXA01.phx.gbl...
Hi Ryan,
You can take advantage of GoTo and Try/Catch block. Not very graceful, but
it does work. :-)
Try
a:
For Each f As Form In My.Application.OpenForms
If f.Name <"Form1" Then
f.Close()
End If
Next
Catch
GoTo a
End Try
Kevin Yu
Microsoft Online Community Support
================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)