Here is the code...<br>============================================================<br>Private Sub Attempt_Logon_Click()<br><br>Dim cnnUser As ADODB.Connection<br>Dim rstUser As New ADODB.Recordset<br>Dim StrFind As String<br>Dim fltMainMenu As String<br><br>Set cnnUser = CurrentProject.Connection<br>Set rstUser = New ADODB.Recordset<br><br>With rstUser<br> .Index = "UserName"<br> .Open Source:="Users", _<br> ActiveConnection:=cnnUser, _<br> CursorType:=adOpenDynamic, _<br> LockType:=adLockReadOnly, _<br> options:=adCmdTableDirect<br> .Seek Array(Me![Username])<br> If .EOF Then<br> MsgBox "Username and/or password incorrect." & Chr(10) & Chr(10) & "Please try again.", vbExclamation<br> attempted = attempted + 1<br> If attempted >= 3 Then<br> DoCmd.Quit<br> End If<br> Me![Password].SetFocus<br> .Close<br> Set cnnUser = Nothing<br> Exit Sub<br> Else<br> If Trim(rstUser![Password]) <> Trim(Me![Password]) Then<br> MsgBox "Username and/or password incorrect." & Chr(10) & Chr(10) & "Please try again.", vbExclamation<br> attempted = attempted + 1<br> If attempted >= 3 Then<br> DoCmd.Quit<br> End If<br> Me![Password].SetFocus<br> .Close<br> Set cnnUser = Nothing<br> Exit Sub<br> Else<br> DoCmd.OpenForm "Main Menu"<br> Forms![Main Menu]![Username] = Me![Username]<br> .Close<br> DoCmd.Close acForm, "logon" 'this form<br> End If<br> End If<br>End With<br><br>Set cnnUser = Nothing<br><br>End Sub<br>============================================================<br><br>The path causing concern is where the logon details are correct and 'Main Menu' is opened. The CLOSE button from the menu then leaves Access 'open' in the background. The .seek method was replaced by using movenext (etc) and this appeared to work although sporadic reoccurrences of Access staying open have since occurred. Note that the .seek method WILL work (i.e not leave Access open) if I replace the variable name with an actual value (such as "Admin"

, but I obviously don't want to do this as it would defeat the object of the login form.<br><br>Code for CLOSING the app from the menu is as follows:<br>============================================================<br>Private Sub Exit_Button_Click()<br>On Error GoTo Err_Close_Click<br><br> Dim CompactAnswer As Variant<br> Dim fs As Object<br> <br> CompactAnswer = MsgBox("Would you like to compact this database now?", vbYesNo, "Compact"

<br> If CompactAnswer = "6" Then<br> DoCmd.Hourglass True<br> DoCmd.Close acForm, "Main Menu"<br> Set fs = CreateObject("Scripting.FileSystemObject"

<br> If fs.FileExists("W:\Sep_Reps\OldData.mdb"

Then<br> fs.DeleteFile ("W:\Sep_Reps\OldData.mdb"

<br> End If<br> DBEngine.CompactDatabase "W:\Sep_Reps\SEPData.mdb", "W:\Sep_Reps\OldData.mdb"<br> fs.CopyFile "W:\Sep_Reps\OldData.mdb", "W:\Sep_Reps\ComData.mdb", True<br> DoCmd.Hourglass False<br> Set fs = Nothing<br> DoCmd.RunCommand acCmdExit<br> ElseIf CompactAnswer = "7" Then<br> DoCmd.RunCommand acCmdExit<br> End If<br> <br> DoCmd.Close<br><br>Exit_Close_Click:<br> Exit Sub<br><br>Err_Close_Click:<br> MsgBox Err.Description<br> Resume Exit_Close_Click<br><br>End Sub<br>============================================================<br>Please note that Access stays 'open even if you quit Access from the menubar or the top right hand close button ('X').<br><br>Any ideas?<br><br>Thanks.<br>