I'm not very fluent with Access coding, as it is different from VB, but I do know that App is a Visual Basic keyword that refers to your application. You may try renaming that variable to something like AccsApp, or remove the line "Dim App as Access.Application" altogether. Also, if Access will let you make Sub Main as the startup object instead of a form, then this is the most effective place to detect for a previous instance (I learned that the hard way making a screen saver, Windows launches several instances of screensavers for some reason ;-)
Another thing you might try if Sub Main isn't an option is to unload all forms using this loop:
Do While Forms.Count > 1
Unload Forms(1)
Loop
Note that this loop unloads all forms except the form where the loop resides. For that reason, you'll still need to include the Unload Me statement after it.
Hope that gives u some ideas!
-Mike
Difference between a madman and a genius:
A madman uses his genius destructively,
A genius uses his madness constructively.