Add this code to the on_click of your exit button, Which will prompt the user if the want to exit, if confirmed then the query is run without warning and the application then closed.
Private Sub btnClose_Click()
Dim Answer As Integer
Dim myRec as dao.recordset
Answer = MsgBox("Do you wish to exit the database?", vbYesNo + vbQuestion + vbDefaultButton1, "Application Title")
If Answer = vbYes Then
DoCmd.SetWarnings False
set myRec=currentdb.openrecordset("NameOfTable")
myRec.addnew
myRec.fields("UserName")=CurrentUser
myRec.fields("TimeOut")=Now
myRec.update
DoCmd.SetWarnings True
DoCmd.Quit
Else
End If
End Sub