
Originally Posted by
Xenia
Hello.
Is there a way to have user and time stamp on a simple access file (*.accdb), that will be used by several users ( 5-6) that will just change and add thing in the file in different locations at the time?
And actually if it can work this way without loosing info while saving?
Yes, it is possible to have a user and timestamp on a simple Access file (*.accdb) that is used by multiple users simultaneously. Here's how you can achieve this:
1. Create a table in your Access database to store the user and timestamp information. Include fields such as "Username," "Timestamp," and any other relevant information.
2. Use VBA code to capture the current user and timestamp whenever a user makes changes to the database. You can use the "Environ" function to retrieve the username and the "Now" function to get the current timestamp. For example:
```vba
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strSQL As String
strSQL = "INSERT INTO TableName (Username, Timestamp) VALUES ('" & Environ("USERNAME") & "', _
#" & Now & "#);"
CurrentDb.Execute strSQL
End Sub
```
Replace "TableName" with the actual name of your table.