"PBrown" <paul.brown@nissan-usa.com> wrote in message
news:02d601c34b0b$7483bd20$a401280a@phx.gbl
> Why won't this quit and exit out of Access:
> Private Sub Form_Close()
> Dim isgm As String
> isgm = InputBox("Restricted Area: Enter Password")
> If UCase(isgm) = "ADMIN" Then
> DoCmd.OpenForm "Editing Switchboard", , , , , , ""
> ElseIf UCase(ismg) = "CLOSE" Then
> DoCmd.Quit
> Application.Quit
> End If
> End Sub
Possibly because you've misspelled the name of your variable isgm in
this line:
> ElseIf UCase(ismg) = "CLOSE" Then
You should set the VB editor option to require explicit declaration of
all variables -- then you'd get a compile error on that statement.

Incidentally, I don't see any reason to have *both* DoCmd.Quit and
Application.Quit in your code.

--
Dirk Goldgar, MS Access MVP
[url]www.datagnostics.com[/url]

(please reply to the newsgroup)