Perhaps you just need a line of code to close the form. Try:
Code:
If Me.pass = "ashley" Then
DoCmd.OpenForm "frmMain"
Else
If Me.pass = Me.UserPass Then
DoCmd.OpenForm "frmMain"
' DoCmd.OpenForm "DetectIdleTime", acFormDS, , , acFormEdit, acHidden
DoCmd.Close acForm, "NameOfYourForm"
Else
Dim Msg, Style, Title, Response, MyString
Msg = "You have entered an Incorrect Password. " & vbCrLf & vbCrLf & "Click OK to retry." & vbCrLf & "Cancel to Close." & vbCrLf & vbCrLf & "If you need access to this database please contact Sandra Clark."
Style = vbOKCancel
Title = "Incorrect Password"
Response = MsgBox(Msg, Style, Title)
If Response = vbOK Then
Me.pass.SetFocus
Else
DoCmd.Quit
End If
End If
End If