Hello all, this is my first post so please don't go harsh on me 
I did as much research as possible prior to this...
So basically, I have a database with user log in form (complete with user levels etc.)
My form, asks for the username and password from the person and checks it with the "tblUsers" table which stores the Id, username, password and level.
Before I used a simple method of integers, counting the number of failed logins.
Exactly the same as some other guys post about Forcing a database to close after 3x logins (can't link it as don't have 10 posts)
It basically, checked for 3 failed attempts and then closed the application.
Recently however I chose to expand this to a more secure system.
What I have inside tblUsers is a new field "LogAttempts".
Where I want to store the login attempts each time, per user.
From this I can then use DLookup to check this value and prevent further access (thus stopping the user closing the application and starting their 3 strikes all over again)
What I need to know is, how do I cause the code to write to the table's exact field for the user trying to login? And of course save it.
Could someone please point me in the right direction (preferable with snippets of code so I can see what you are on about, I'm a visual learner)
My Code
Many thanks in advance.
PS. My coding knowledge is all self taught so I probably picked up bad habits, or I may lack certain knowledge, if this is the case, please kindly correct me rather than getting irritated, its much more constructive and helpful for me. Thank you.

I did as much research as possible prior to this...
So basically, I have a database with user log in form (complete with user levels etc.)
My form, asks for the username and password from the person and checks it with the "tblUsers" table which stores the Id, username, password and level.
Before I used a simple method of integers, counting the number of failed logins.
Exactly the same as some other guys post about Forcing a database to close after 3x logins (can't link it as don't have 10 posts)
It basically, checked for 3 failed attempts and then closed the application.
Recently however I chose to expand this to a more secure system.
What I have inside tblUsers is a new field "LogAttempts".
Where I want to store the login attempts each time, per user.
From this I can then use DLookup to check this value and prevent further access (thus stopping the user closing the application and starting their 3 strikes all over again)
What I need to know is, how do I cause the code to write to the table's exact field for the user trying to login? And of course save it.
Could someone please point me in the right direction (preferable with snippets of code so I can see what you are on about, I'm a visual learner)
My Code
Code:
private LogAttempt as Integer
Code:
Public Sub Login()
On Error GoTo ErrorHandler:
If IsNull([cboUser]) = True Then 'Check UserName
MsgBox "Username is required"
ElseIf IsNull([txtPassword]) = True Then 'Check Password
MsgBox "Password is required"
Else
'Compare value of txtPassword with the saved Password in tblUser
If Me.txtPassword.Value = DLookup("Password", "tblUsers", "[UserName]='" & Me.cboUser.Value & "'") Then
strUser = Me.cboUser.Value 'Set the value of strUser declared as Global Variable
strLevel = DLookup("Level", "tblUsers", "[UserName]='" & Me.cboUser.Value & "'") 'set the value of strLevel declared as Global Variable
DoCmd.Close acForm, "frmLogin", acSaveNo
MsgBox "The login was successful! Welcome Back, " & strUser, vbOKOnly, "Welcome"
DoCmd.OpenForm "frmMenu", acNormal, "", "", , acNormal
Else
MsgBox "Invalid Password. Please try again.", vbOKOnly, "Invalid Password"
LogAttempt = LogAttempt + 1
txtPassword.SetFocus
End If
End If
'Check if the user has 3 wrong log-in attempts and close the application
If LogAttempt = 3 Then
MsgBox "Your account has been locked due to failed login, please contact an admin." & vbCrLf & vbCrLf & _
"Application will quit.", vbCritical, "Restricted Access!"
Application.Quit
End If
ErrorHandler:
End Sub
Many thanks in advance.

PS. My coding knowledge is all self taught so I probably picked up bad habits, or I may lack certain knowledge, if this is the case, please kindly correct me rather than getting irritated, its much more constructive and helpful for me. Thank you.