Re: Bring form to front

From: Bruce (anonymous_at_discussions.microsoft.com)
Date: 09/14/04


Date: Tue, 14 Sep 2004 08:30:41 -0700

Maybe this doesn't exactly address the reason for the
behavior, but you could add this code to the Open even of
the form in question:
DoCmd.OpenForm "frmPassword", , , , , acDialog
frmPassword (or whatever you call your password form) is
set to Popup and Modal. A command button on the password
form would contain code for the Click event along the
lines of (underscore means no line break):
    If Me.txtPassword = "LuckyGuess" Then
        DoCmd.OpenForm "frmMain"
    Else
        MsgBox "Invalid password", _
vbInformation, "Password Error"
        DoCmd.Close acForm, "frmMain"
    End If

    DoCmd.Close

>-----Original Message-----
>A button from my switchboard links to a form with a hard
coded password.
>When the password is correct, the password form closes
and the protected form
>opens. The problem is that it opens behind the
switchboard (which I do what
>to remain open behind the working form) Other forms that
are not password
>protected and open from a button on the switchboard open
in front of the
>switchboard. Before the form with the password
protection had the password
>added, it also opened in front. How do it get this to
open in front of the
>switchboard?
>.
>