I know that this works for the complete app to stop a duplicate app from running

If App.PrevInstance = True Then
End
End If

How can I modify this code to not allow a form from being opened more than once at the same time.

Thanks for your help