Hello Everyone,
I apologise if that has already been asked/answered but...
I have an append query (qryLogInTime) that runs when a form loads, it saves the information of the date and time that a username logs in to my database to a table (tblLogInTime).
The issue is it will on the first occasion you open a form save 1 record of your login, the next time 2 records, then 4, then 8 and it will continue to double each time the form is opened.
I don't know how to stop it.
The public function that is used to get the username is: -
Public Function GetUserLogIn()
GetUserLogIn = Environ("UserName")
End Function
The VBA i've used for the on load function is: -
Private Sub Form_Load()
Dim User As String
User = Environ("Username")
Dim strDocName As String
strDocName = "qryLogInTime"
DoCmd.OpenQuery strDocName, acViewNormal, acEdit
End Sub
The append query that is ran: -
Hope someone can see where this rookie has gone wrong, or I may have to formulate a plan B.
Thanks in advance for any assistance!
Joe