|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
User Tracking in AccessMy office runs an Access database, and I have need to be able to view when
each employee logs in/logs out....Are there any thoughts on this??? I would also like to be able to track whom was the last user to change a record...any help would be appreciated. Thanks Both of these are asked pretty often. Do a search and read the previous
posts on how to log user access to the database, and how to timestamp changes. You could also look at how to do audit trails if you want to track what changes were made to the data. -- Show quoteHide quoteRick B "Cgilsy" <Cgi***@discussions.microsoft.com> wrote in message news:295AEE9E-0706-425B-A6A9-0F648740F2D6@microsoft.com... > My office runs an Access database, and I have need to be able to view when > each employee logs in/logs out....Are there any thoughts on this??? I > would > also like to be able to track whom was the last user to change a > record...any > help would be appreciated. > Thanks > "Cgilsy" <Cgi***@discussions.microsoft.com> wrote in message Yes, Access can do this. Check out the help for the "ENVIRON" property. I news:295AEE9E-0706-425B-A6A9-0F648740F2D6@microsoft.com... > My office runs an Access database, and I have need to be able to view when > each employee logs in/logs out....Are there any thoughts on this??? I > would > also like to be able to track whom was the last user to change a > record...any > help would be appreciated. > Thanks > use this to gather network user information for audit purposes. To track "last changed by" (and when) you'd need two new fields in your main table, one for name and the other for date/time. You would update the fields using your form's BeforeUpdate event. It is also possible to create an audit trail of changes using a similar method. Hope that's enough to get you started. Regards, Keith. www.keithwilby.com Keith,
How would you set up the code in the BeforeUpdate Event? I would like to use this as well. Thanks Show quoteHide quote "Keith" wrote: > "Cgilsy" <Cgi***@discussions.microsoft.com> wrote in message > news:295AEE9E-0706-425B-A6A9-0F648740F2D6@microsoft.com... > > My office runs an Access database, and I have need to be able to view when > > each employee logs in/logs out....Are there any thoughts on this??? I > > would > > also like to be able to track whom was the last user to change a > > record...any > > help would be appreciated. > > Thanks > > > > Yes, Access can do this. Check out the help for the "ENVIRON" property. I > use this to gather network user information for audit purposes. > > To track "last changed by" (and when) you'd need two new fields in your main > table, one for name and the other for date/time. You would update the > fields using your form's BeforeUpdate event. It is also possible to create > an audit trail of changes using a similar method. Hope that's enough to get > you started. > > Regards, > Keith. > www.keithwilby.com > > > "Secret Squirrel" <secretsquir***@discussions.microsoft.com> wrote in Something like:message news:CAF4D5BF-08F0-4BED-95B6-3B9013138A5F@microsoft.com... > Keith, > How would you set up the code in the BeforeUpdate Event? I would like to > use > this as well. > Dim strUserName As String strUserName = Environ("USERNAME") Me.txtUser = strUserName Me.txtUpdated = Now() Regards, Keith. www.keithwilby.com Keith,
What if I wanted to expand this to show user tracking for each field? Can I create another table to keep this information? If so, how would I go about that? Show quoteHide quote "Keith" wrote: > "Secret Squirrel" <secretsquir***@discussions.microsoft.com> wrote in > message news:CAF4D5BF-08F0-4BED-95B6-3B9013138A5F@microsoft.com... > > Keith, > > How would you set up the code in the BeforeUpdate Event? I would like to > > use > > this as well. > > > > Something like: > > Dim strUserName As String > strUserName = Environ("USERNAME") > Me.txtUser = strUserName > Me.txtUpdated = Now() > > Regards, > Keith. > www.keithwilby.com > > > "Secret Squirrel" <secretsquir***@discussions.microsoft.com> wrote in Yes, create a new table with fields for time stamps, user ID, record ID and message news:47C20040-7199-470F-B7C1-AE6196E446F9@microsoft.com... > Keith, > What if I wanted to expand this to show user tracking for each field? Can > I > create another table to keep this information? If so, how would I go about > that? > > "Keith" wrote: > old and new values. You'd then need to use the before/after update events on your forms to trigger the recording of the data. It's not a two minute job though. Regards, Keith. www.keithwilby.com How would I link this new tracking table to the table I want to track?
Show quoteHide quote "Keith W" wrote: > "Secret Squirrel" <secretsquir***@discussions.microsoft.com> wrote in > message news:47C20040-7199-470F-B7C1-AE6196E446F9@microsoft.com... > > Keith, > > What if I wanted to expand this to show user tracking for each field? Can > > I > > create another table to keep this information? If so, how would I go about > > that? > > > > "Keith" wrote: > > > > Yes, create a new table with fields for time stamps, user ID, record ID and > old and new values. You'd then need to use the before/after update events > on your forms to trigger the recording of the data. It's not a two minute > job though. > > Regards, > Keith. > www.keithwilby.com > > > You might want to study what Allen Browne has on this.
Creating an Audit Log http://www.allenbrowne.com/AppAudit.html -- Show quoteHide quoteJoan Wild Microsoft Access MVP Secret Squirrel wrote: > How would I link this new tracking table to the table I want to track? > > "Keith W" wrote: > >> "Secret Squirrel" <secretsquir***@discussions.microsoft.com> wrote in >> message news:47C20040-7199-470F-B7C1-AE6196E446F9@microsoft.com... >>> Keith, >>> What if I wanted to expand this to show user tracking for each >>> field? Can I >>> create another table to keep this information? If so, how would I >>> go about that? >>> >>> "Keith" wrote: >>> >> >> Yes, create a new table with fields for time stamps, user ID, record >> ID and old and new values. You'd then need to use the before/after >> update events on your forms to trigger the recording of the data. >> It's not a two minute job though. >> >> Regards, >> Keith. >> www.keithwilby.com Ok I've followed the instructions from the link you gave me but I'm a little
unclear what he means by removing the 4 references to the function "LogError()". Can you shed some light on how I remove these and where they are located? Show quoteHide quote "Joan Wild" wrote: > You might want to study what Allen Browne has on this. > Creating an Audit Log > http://www.allenbrowne.com/AppAudit.html > > -- > Joan Wild > Microsoft Access MVP > > Secret Squirrel wrote: > > How would I link this new tracking table to the table I want to track? > > > > "Keith W" wrote: > > > >> "Secret Squirrel" <secretsquir***@discussions.microsoft.com> wrote in > >> message news:47C20040-7199-470F-B7C1-AE6196E446F9@microsoft.com... > >>> Keith, > >>> What if I wanted to expand this to show user tracking for each > >>> field? Can I > >>> create another table to keep this information? If so, how would I > >>> go about that? > >>> > >>> "Keith" wrote: > >>> > >> > >> Yes, create a new table with fields for time stamps, user ID, record > >> ID and old and new values. You'd then need to use the before/after > >> update events on your forms to trigger the recording of the data. > >> It's not a two minute job though. > >> > >> Regards, > >> Keith. > >> www.keithwilby.com > > > I haven't used it, but a quick perusal... He says to "copy this code" to a
new module. If you search that code for logerror, you'll find 5 statements like Call LogError(.... Just put an apostrophe at the beginning of these lines. -- Show quoteHide quoteJoan Wild Microsoft Access MVP Secret Squirrel wrote: > Ok I've followed the instructions from the link you gave me but I'm a > little unclear what he means by removing the 4 references to the > function "LogError()". Can you shed some light on how I remove these > and where they are located? > > "Joan Wild" wrote: > >> You might want to study what Allen Browne has on this. >> Creating an Audit Log >> http://www.allenbrowne.com/AppAudit.html >> >> -- >> Joan Wild >> Microsoft Access MVP >> >> Secret Squirrel wrote: >>> How would I link this new tracking table to the table I want to >>> track? >>> >>> "Keith W" wrote: >>> >>>> "Secret Squirrel" <secretsquir***@discussions.microsoft.com> wrote >>>> in message >>>> news:47C20040-7199-470F-B7C1-AE6196E446F9@microsoft.com... >>>>> Keith, >>>>> What if I wanted to expand this to show user tracking for each >>>>> field? Can I >>>>> create another table to keep this information? If so, how would I >>>>> go about that? >>>>> >>>>> "Keith" wrote: >>>>> >>>> >>>> Yes, create a new table with fields for time stamps, user ID, >>>> record ID and old and new values. You'd then need to use the >>>> before/after update events on your forms to trigger the recording >>>> of the data. It's not a two minute job though. >>>> >>>> Regards, >>>> Keith. >>>> www.keithwilby.com Ok I did that now I'm getting an error "Method or data number not found".
Here is the line it is referring to. Can you help with this one? Private Sub Form_BeforeUpdate(Cancel As Integer) bWasNewRecord = Me.NewRecord Call AuditEditBegin("tblRMA", "audtmpRMA", "RMA", Nz(Me.RMA, 0), bWasNewRecord) Show quoteHide quote "Joan Wild" wrote: > I haven't used it, but a quick perusal... He says to "copy this code" to a > new module. If you search that code for logerror, you'll find 5 statements > like > > Call LogError(.... > Just put an apostrophe at the beginning of these lines. > > > -- > Joan Wild > Microsoft Access MVP > > Secret Squirrel wrote: > > Ok I've followed the instructions from the link you gave me but I'm a > > little unclear what he means by removing the 4 references to the > > function "LogError()". Can you shed some light on how I remove these > > and where they are located? > > > > "Joan Wild" wrote: > > > >> You might want to study what Allen Browne has on this. > >> Creating an Audit Log > >> http://www.allenbrowne.com/AppAudit.html > >> > >> -- > >> Joan Wild > >> Microsoft Access MVP > >> > >> Secret Squirrel wrote: > >>> How would I link this new tracking table to the table I want to > >>> track? > >>> > >>> "Keith W" wrote: > >>> > >>>> "Secret Squirrel" <secretsquir***@discussions.microsoft.com> wrote > >>>> in message > >>>> news:47C20040-7199-470F-B7C1-AE6196E446F9@microsoft.com... > >>>>> Keith, > >>>>> What if I wanted to expand this to show user tracking for each > >>>>> field? Can I > >>>>> create another table to keep this information? If so, how would I > >>>>> go about that? > >>>>> > >>>>> "Keith" wrote: > >>>>> > >>>> > >>>> Yes, create a new table with fields for time stamps, user ID, > >>>> record ID and old and new values. You'd then need to use the > >>>> before/after update events on your forms to trigger the recording > >>>> of the data. It's not a two minute job though. > >>>> > >>>> Regards, > >>>> Keith. > >>>> www.keithwilby.com > > > That function has four arguments not five as in your statement.
Function AuditDelBegin(sTable As String, sAudTmpTable As String, sKeyField As String, lngKeyValue As Long) As Boolean It also appears as though your KeyValue might be null? That doesn't make sense to me. -- Show quoteHide quoteJoan Wild Microsoft Access MVP Secret Squirrel wrote: > Ok I did that now I'm getting an error "Method or data number not > found". Here is the line it is referring to. Can you help with this > one? > > Private Sub Form_BeforeUpdate(Cancel As Integer) > > bWasNewRecord = Me.NewRecord > Call AuditEditBegin("tblRMA", "audtmpRMA", "RMA", Nz(Me.RMA, 0), > bWasNewRecord) > > > > > "Joan Wild" wrote: > >> I haven't used it, but a quick perusal... He says to "copy this >> code" to a new module. If you search that code for logerror, you'll >> find 5 statements like >> >> Call LogError(.... >> Just put an apostrophe at the beginning of these lines. >> >> >> -- >> Joan Wild >> Microsoft Access MVP >> >> Secret Squirrel wrote: >>> Ok I've followed the instructions from the link you gave me but I'm >>> a little unclear what he means by removing the 4 references to the >>> function "LogError()". Can you shed some light on how I remove these >>> and where they are located? >>> >>> "Joan Wild" wrote: >>> >>>> You might want to study what Allen Browne has on this. >>>> Creating an Audit Log >>>> http://www.allenbrowne.com/AppAudit.html >>>> >>>> -- >>>> Joan Wild >>>> Microsoft Access MVP >>>> >>>> Secret Squirrel wrote: >>>>> How would I link this new tracking table to the table I want to >>>>> track? >>>>> >>>>> "Keith W" wrote: >>>>> >>>>>> "Secret Squirrel" <secretsquir***@discussions.microsoft.com> >>>>>> wrote in message >>>>>> news:47C20040-7199-470F-B7C1-AE6196E446F9@microsoft.com... >>>>>>> Keith, >>>>>>> What if I wanted to expand this to show user tracking for each >>>>>>> field? Can I >>>>>>> create another table to keep this information? If so, how would >>>>>>> I go about that? >>>>>>> >>>>>>> "Keith" wrote: >>>>>>> >>>>>> >>>>>> Yes, create a new table with fields for time stamps, user ID, >>>>>> record ID and old and new values. You'd then need to use the >>>>>> before/after update events on your forms to trigger the recording >>>>>> of the data. It's not a two minute job though. >>>>>> >>>>>> Regards, >>>>>> Keith. >>>>>> www.keithwilby.com I figured out the problem for this one. He had "(Me.InvoiceID, 0)" on the
website. I changed it to "(Me!InvoiceID, 0)" and now it works fine. I guess it was just a typo on his part. Unless I'm missing something here??? Show quoteHide quote "Joan Wild" wrote: > That function has four arguments not five as in your statement. > > Function AuditDelBegin(sTable As String, sAudTmpTable As String, sKeyField > As String, lngKeyValue As Long) As Boolean > > It also appears as though your KeyValue might be null? That doesn't make > sense to me. > > -- > Joan Wild > Microsoft Access MVP > > Secret Squirrel wrote: > > Ok I did that now I'm getting an error "Method or data number not > > found". Here is the line it is referring to. Can you help with this > > one? > > > > Private Sub Form_BeforeUpdate(Cancel As Integer) > > > > bWasNewRecord = Me.NewRecord > > Call AuditEditBegin("tblRMA", "audtmpRMA", "RMA", Nz(Me.RMA, 0), > > bWasNewRecord) > > > > > > > > > > "Joan Wild" wrote: > > > >> I haven't used it, but a quick perusal... He says to "copy this > >> code" to a new module. If you search that code for logerror, you'll > >> find 5 statements like > >> > >> Call LogError(.... > >> Just put an apostrophe at the beginning of these lines. > >> > >> > >> -- > >> Joan Wild > >> Microsoft Access MVP > >> > >> Secret Squirrel wrote: > >>> Ok I've followed the instructions from the link you gave me but I'm > >>> a little unclear what he means by removing the 4 references to the > >>> function "LogError()". Can you shed some light on how I remove these > >>> and where they are located? > >>> > >>> "Joan Wild" wrote: > >>> > >>>> You might want to study what Allen Browne has on this. > >>>> Creating an Audit Log > >>>> http://www.allenbrowne.com/AppAudit.html > >>>> > >>>> -- > >>>> Joan Wild > >>>> Microsoft Access MVP > >>>> > >>>> Secret Squirrel wrote: > >>>>> How would I link this new tracking table to the table I want to > >>>>> track? > >>>>> > >>>>> "Keith W" wrote: > >>>>> > >>>>>> "Secret Squirrel" <secretsquir***@discussions.microsoft.com> > >>>>>> wrote in message > >>>>>> news:47C20040-7199-470F-B7C1-AE6196E446F9@microsoft.com... > >>>>>>> Keith, > >>>>>>> What if I wanted to expand this to show user tracking for each > >>>>>>> field? Can I > >>>>>>> create another table to keep this information? If so, how would > >>>>>>> I go about that? > >>>>>>> > >>>>>>> "Keith" wrote: > >>>>>>> > >>>>>> > >>>>>> Yes, create a new table with fields for time stamps, user ID, > >>>>>> record ID and old and new values. You'd then need to use the > >>>>>> before/after update events on your forms to trigger the recording > >>>>>> of the data. It's not a two minute job though. > >>>>>> > >>>>>> Regards, > >>>>>> Keith. > >>>>>> www.keithwilby.com > > > |
|||||||||||||||||||||||